You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to change within a function only the number of required workers so that a user can over-ride locally the number of workers that was set globally. (I want to keep the global strategy.) This might look like
plan(multicore, workers = 5) # global setting
do_something <- function(arg1, arg2, number_of_cores) {
...
oplan <- future::plan()
<change temporarily the number of workers to number_of_cores> # local setting
on.exit(future::plan(oplan, add=TRUE)
...
}
do_something(x, y, 3)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I would like to change within a function only the number of required workers so that a user can over-ride locally the number of workers that was set globally. (I want to keep the global strategy.) This might look like
I appreciate your consideration and guidance.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions