Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions vignettes/articles/progress.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ my_pkg_fn <- function(x) {
p <- progressor(steps = length(x))

future_map(x, ~{
p()
Sys.sleep(.2)
sum(.x)
out <- sum(.x)
p()
out
})
}
```
Expand Down Expand Up @@ -94,9 +95,10 @@ with_progress({
p <- progressor(steps = length(x))

result <- future_map(x, ~{
p()
Sys.sleep(.2)
sum(.x)
out <- sum(.x)
p()
out
})
})
#> |===================== | 20%
Expand All @@ -110,9 +112,10 @@ Rather than writing an anonymous function, you might want to wrap the logic of `
plan(multisession, workers = 2)

fn <- function(x, p) {
p()
Sys.sleep(.2)
sum(x)
out <- sum(x)
p()
out
}

with_progress({
Expand Down