Description Usage Arguments Details
Bulk queuing. Similar in some respects to things like
apply
. This is an experiment to deal with the
pattern where you have a big pile of parameters in a data.frame to
loop over, by applying a function to each row.
1 2 3 4 5 6 | enqueue_bulk(X, FUN, rrq, do.call = FALSE, group = NULL, timeout = Inf,
time_poll = 1, delete_tasks = FALSE, progress_bar = TRUE,
env = parent.frame())
enqueue_bulk_submit(X, FUN, rrq, do.call = FALSE, group = NULL,
progress_bar = TRUE, env = parent.frame())
|
X |
An object to loop over. If a list, we'll loop over the
elements of the list, duplicating the behaviour of
|
FUN |
A function. Will be found in the same way as
|
rrq |
An rrq object |
do.call |
Behave like (but not via) |
group |
Name of a group for generated task ids. If not included, an ID will be generated. |
timeout |
Total length of time to wait for tasks to be
completed. The default is to wait forever (like |
time_poll |
Time to poll for tasks. Must be an integer. Because of how the function is implemented, R will be unresponsive for this long each iteration (unless results are returned), so the default of 1s should be reasonable. |
delete_tasks |
Delete tasks on successful finish? |
progress_bar |
Display a progress bar? |
env |
Environment to look in |
There are two modes here; selected with do.call
. With
do.call=FALSE
, the default, the function behaves similarly
to apply(X, FUN, 1)
; that is the function is applied to
each row of the data.frame (as a list):
FUN(as.list(X[1,]))
, FUN(as.list(X[2,]))
, and so on.
The alternative mode (do.call=TRUE
) is where the
data.frame
contains parameters to the function
FUN
so equivalent to FUN(X[1,1], X[1,2], ...
. This
is similar (but not implemented as) running: do.call("FUN",
as.list(X[1,]))
.
Be careful, this one is going to change, including the name probably. You have been warned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.