llply {plyr}R Documentation

Split list, apply function, and return results in a list

Description

For each element of a list, apply function then combine results into a list

Usage

llply(.data, .fun = NULL, ..., .progress = "none")

Arguments

.data list to be processed
.fun function to apply to each piece
... other arguments passed on to .fun
.progress name of the progress bar to use, see create_progress_bar

Details

All plyr functions use the same split-apply-combine strategy: they split the input into simpler pieces, apply .fun to each piece, and then combine the pieces into a single data structure. This function splits lists by elements and combines the result into a list. 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.

@keyword manip @arguments list to be processed @arguments function to apply to each piece @arguments other arguments passed on to .fun @arguments name of the progress bar to use, see create_progress_bar @value list of results

Value

list of results

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

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)

[Package plyr version 0.1.5 Index]