Last chance! 50% off unlimited learning
Sale ends in
For each element of a list, apply function, keeping results as a list.
llply(
.data,
.fun = NULL,
...,
.progress = "none",
.inform = FALSE,
.parallel = FALSE,
.paropts = NULL
)
list of results
list to be processed
function to apply to each piece
other arguments passed on to .fun
name of the progress bar to use, see
create_progress_bar
produce informative error messages? This is turned off by default because it substantially slows processing speed, but is very useful for debugging
if TRUE
, apply function in parallel, using parallel
backend provided by foreach
a list of additional options passed into
the foreach
function when parallel computation
is enabled. This is important if (for example) your code relies on
external data or packages: use the .export
and .packages
arguments to supply them so that all cluster nodes have the correct
environment set up for computing.
This function splits lists by elements.
If there are no results, then this function will return
a list of length 0 (list()
).
llply
is equivalent to lapply
except that it will
preserve labels and can display a progress bar.
Hadley Wickham (2011). The Split-Apply-Combine Strategy for Data Analysis. Journal of Statistical Software, 40(1), 1-29. https://www.jstatsoft.org/v40/i01/.
Other list input:
l_ply()
,
laply()
,
ldply()
Other list output:
alply()
,
dlply()
,
mlply()
llply(llply(mtcars, round), table)
llply(baseball, summary)
# Examples from ?lapply
x <- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE))
llply(x, mean)
llply(x, quantile, probs = 1:3/4)
Run the code above in your browser using DataLab