public
Description: A R package for splitting, applying and combining large problems into simpler problems
Homepage: http://had.co.nz/plyr
Clone URL: git://github.com/hadley/plyr.git
hadley (author)
Thu Oct 29 17:29:50 -0700 2009
commit  aac3c938815787948eb3732967bb4926d8774378
tree    8ca39fd6714561c83a0eb424370b1744f385649c
parent  2686e4f9d64eda02c5dfc3bb17b2dda6dbac15a5
plyr / plyr-doc.txt
100644 39 lines (27 sloc) 1.62 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Split list, apply function, and return results in a data frame
For each element of a list, apply function then combine results into a data frame
 
All plyr functions use the same split-apply-combine strategy: they split the input into simpler pieces, apply \code{.fun} to each piece, and then combine the pieces into a single data structure. This function splits
 
matrices, arrays and data frames by dimensions
data frames by variable
lists by elements
 
and combines the result into a data frame
and combines the result into an array
and combines the result into a list
and discards the output
 
If there are no results, then this function will return
 
a data frame with zero rows and columns (\code{data.frame()}).
a vector of length 0 (\code{vector()}).
a list of length 0 (\code{list()}).
 
See \code{vignette("intro", "plyr")} for more details, description and case studies.
 
@keywords manip
 
@param matrix, array or data frame to be processed
@param list to be processed
@param data frame to be processed
 
@param variables to split data frame by, as quoted variables, a formula or character vector
@param a vector giving the subscripts to split up \code{data} by. 1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
 
@param function to apply to each piece
@param other arguments passed on to \code{.fun}
@param name of the progress bar to use, see \code{\link{create_progress_bar}}
 
@return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
@return list of results
@return a data frame