Skip to content

Commit 1d14385

Browse files
Merge branch 'develop' of github.com:HenrikBengtsson/progressr into develop [ci skip]
2 parents f56f602 + 1486356 commit 1d14385

File tree

3 files changed

+48
-21
lines changed

3 files changed

+48
-21
lines changed

OVERVIEW.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ we will get:
284284

285285
```r
286286
> library(progressr)
287+
> handlers(global = TRUE)
287288
> handlers("progress")
288289
> y <- slow_sqrt(1:8)
289290
Calculating the square root of 1
@@ -306,6 +307,7 @@ Note that progression updates by **progressr** is designed to work out of the bo
306307

307308
```r
308309
library(progressr)
310+
handlers(global = TRUE)
309311

310312
my_fcn <- function(xs) {
311313
p <- progressor(along = xs)
@@ -314,7 +316,7 @@ my_fcn <- function(xs) {
314316
p(sprintf("x=%g", x))
315317
sqrt(x)
316318
})
317-
})
319+
}
318320

319321
my_fcn(1:5)
320322
# |==================== | 40%
@@ -326,6 +328,7 @@ my_fcn(1:5)
326328
```r
327329
library(foreach)
328330
library(progressr)
331+
handlers(global = TRUE)
329332

330333
my_fcn <- function(xs) {
331334
p <- progressor(along = xs)
@@ -345,6 +348,7 @@ my_fcn(1:5)
345348
```r
346349
library(purrr)
347350
library(progressr)
351+
handlers(global = TRUE)
348352

349353
my_fcn <- function(xs) {
350354
p <- progressor(along = xs)
@@ -353,7 +357,7 @@ my_fcn <- function(xs) {
353357
p(sprintf("x=%g", x))
354358
sqrt(x)
355359
})
356-
})
360+
}
357361

358362
my_fcn(1:5)
359363
# |==================== | 40%
@@ -365,6 +369,7 @@ my_fcn(1:5)
365369
```r
366370
library(plyr)
367371
library(progressr)
372+
handlers(global = TRUE)
368373

369374
my_fcn <- function(xs) {
370375
p <- progressor(along = xs)
@@ -373,7 +378,7 @@ my_fcn <- function(xs) {
373378
p(sprintf("x=%g", x))
374379
sqrt(x)
375380
})
376-
})
381+
}
377382

378383
my_fcn(1:5)
379384
# |==================== | 40%
@@ -396,6 +401,7 @@ library(future.apply)
396401
plan(multisession)
397402

398403
library(progressr)
404+
handlers(global = TRUE)
399405
handlers("progress", "beepr")
400406

401407
my_fcn <- function(xs) {
@@ -405,7 +411,7 @@ my_fcn <- function(xs) {
405411
p(sprintf("x=%g", x))
406412
sqrt(x)
407413
})
408-
})
414+
}
409415

410416
my_fcn(1:5)
411417
# / [================>-----------------------------] 40% x=2
@@ -422,6 +428,7 @@ registerDoFuture()
422428
plan(multisession)
423429

424430
library(progressr)
431+
handlers(global = TRUE)
425432
handlers("progress", "beepr")
426433

427434
my_fcn <- function(xs) {
@@ -431,7 +438,7 @@ my_fcn <- function(xs) {
431438
p(sprintf("x=%g", x))
432439
sqrt(x)
433440
}
434-
})
441+
}
435442

436443
my_fcn(1:5)
437444
# / [================>-----------------------------] 40% x=2
@@ -447,6 +454,7 @@ library(furrr)
447454
plan(multisession)
448455

449456
library(progressr)
457+
handlers(global = TRUE)
450458
handlers("progress", "beepr")
451459

452460
my_fcn <- function(xs) {
@@ -456,7 +464,7 @@ my_fcn <- function(xs) {
456464
p(sprintf("x=%g", x))
457465
sqrt(x)
458466
})
459-
})
467+
}
460468

461469
my_fcn(1:5)
462470
# / [================>-----------------------------] 40% x=2
@@ -476,6 +484,7 @@ registerDoFuture()
476484
plan(multisession)
477485

478486
library(progressr)
487+
handlers(global = TRUE)
479488
handlers("progress", "beepr")
480489

481490
my_fcn <- function(xs) {
@@ -485,7 +494,7 @@ my_fcn <- function(xs) {
485494
p(sprintf("x=%g", x))
486495
sqrt(x)
487496
}, .parallel = TRUE)
488-
})
497+
}
489498

490499
my_fcn(1:5)
491500
# / [================>-----------------------------] 40% x=2

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ we will get:
289289

290290
```r
291291
> library(progressr)
292+
> handlers(global = TRUE)
292293
> handlers("progress")
293294
> y <- slow_sqrt(1:8)
294295
Calculating the square root of 1
@@ -311,6 +312,7 @@ Note that progression updates by **progressr** is designed to work out of the bo
311312

312313
```r
313314
library(progressr)
315+
handlers(global = TRUE)
314316

315317
my_fcn <- function(xs) {
316318
p <- progressor(along = xs)
@@ -319,7 +321,7 @@ my_fcn <- function(xs) {
319321
p(sprintf("x=%g", x))
320322
sqrt(x)
321323
})
322-
})
324+
}
323325

324326
my_fcn(1:5)
325327
# |==================== | 40%
@@ -331,6 +333,7 @@ my_fcn(1:5)
331333
```r
332334
library(foreach)
333335
library(progressr)
336+
handlers(global = TRUE)
334337

335338
my_fcn <- function(xs) {
336339
p <- progressor(along = xs)
@@ -350,6 +353,7 @@ my_fcn(1:5)
350353
```r
351354
library(purrr)
352355
library(progressr)
356+
handlers(global = TRUE)
353357

354358
my_fcn <- function(xs) {
355359
p <- progressor(along = xs)
@@ -358,7 +362,7 @@ my_fcn <- function(xs) {
358362
p(sprintf("x=%g", x))
359363
sqrt(x)
360364
})
361-
})
365+
}
362366

363367
my_fcn(1:5)
364368
# |==================== | 40%
@@ -370,6 +374,7 @@ my_fcn(1:5)
370374
```r
371375
library(plyr)
372376
library(progressr)
377+
handlers(global = TRUE)
373378

374379
my_fcn <- function(xs) {
375380
p <- progressor(along = xs)
@@ -378,7 +383,7 @@ my_fcn <- function(xs) {
378383
p(sprintf("x=%g", x))
379384
sqrt(x)
380385
})
381-
})
386+
}
382387

383388
my_fcn(1:5)
384389
# |==================== | 40%
@@ -401,6 +406,7 @@ library(future.apply)
401406
plan(multisession)
402407

403408
library(progressr)
409+
handlers(global = TRUE)
404410
handlers("progress", "beepr")
405411

406412
my_fcn <- function(xs) {
@@ -410,7 +416,7 @@ my_fcn <- function(xs) {
410416
p(sprintf("x=%g", x))
411417
sqrt(x)
412418
})
413-
})
419+
}
414420

415421
my_fcn(1:5)
416422
# / [================>-----------------------------] 40% x=2
@@ -427,6 +433,7 @@ registerDoFuture()
427433
plan(multisession)
428434

429435
library(progressr)
436+
handlers(global = TRUE)
430437
handlers("progress", "beepr")
431438

432439
my_fcn <- function(xs) {
@@ -436,7 +443,7 @@ my_fcn <- function(xs) {
436443
p(sprintf("x=%g", x))
437444
sqrt(x)
438445
}
439-
})
446+
}
440447

441448
my_fcn(1:5)
442449
# / [================>-----------------------------] 40% x=2
@@ -452,6 +459,7 @@ library(furrr)
452459
plan(multisession)
453460

454461
library(progressr)
462+
handlers(global = TRUE)
455463
handlers("progress", "beepr")
456464

457465
my_fcn <- function(xs) {
@@ -461,7 +469,7 @@ my_fcn <- function(xs) {
461469
p(sprintf("x=%g", x))
462470
sqrt(x)
463471
})
464-
})
472+
}
465473

466474
my_fcn(1:5)
467475
# / [================>-----------------------------] 40% x=2
@@ -481,6 +489,7 @@ registerDoFuture()
481489
plan(multisession)
482490

483491
library(progressr)
492+
handlers(global = TRUE)
484493
handlers("progress", "beepr")
485494

486495
my_fcn <- function(xs) {
@@ -490,7 +499,7 @@ my_fcn <- function(xs) {
490499
p(sprintf("x=%g", x))
491500
sqrt(x)
492501
}, .parallel = TRUE)
493-
})
502+
}
494503

495504
my_fcn(1:5)
496505
# / [================>-----------------------------] 40% x=2

0 commit comments

Comments
 (0)