Skip to content

Commit

Permalink
Examples did not work in R (< 4.0.0), because they used the new lambd…
Browse files Browse the repository at this point in the history
…a notation
  • Loading branch information
HenrikBengtsson committed Apr 12, 2024
1 parent 9a91f38 commit 0964136
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: future.mirai
Version: 0.1.1-9018
Version: 0.1.1-9019
Depends:
future
Imports:
Expand Down
2 changes: 1 addition & 1 deletion incl/mirai_cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mirai::daemons(parallelly::availableCores(), dispatcher = FALSE)
plan(mirai_cluster)

# A function that returns a future, note that N uses lexical scoping...
f <- \() future({4 * sum((runif(N) ^ 2 + runif(N) ^ 2) < 1) / N}, seed = TRUE)
f <- function() future({4 * sum((runif(N) ^ 2 + runif(N) ^ 2) < 1) / N}, seed = TRUE)

# Run a simple sampling approximation of pi in parallel using M * N points:
N <- 1e6 # samples per worker
Expand Down
2 changes: 1 addition & 1 deletion incl/mirai_multisession.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plan(mirai_multisession)

# A function that returns a future, note that N uses lexical scoping...
f <- \() future({4 * sum((runif(N) ^ 2 + runif(N) ^ 2) < 1) / N}, seed = TRUE)
f <- function() future({4 * sum((runif(N) ^ 2 + runif(N) ^ 2) < 1) / N}, seed = TRUE)

# Run a simple sampling approximation of pi in parallel using M * N points:
N <- 1e6 # samples per worker
Expand Down
2 changes: 1 addition & 1 deletion man/mirai_cluster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mirai_multisession.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0964136

Please sign in to comment.