| dtapply | R Documentation |
A convenience function that returns a data.frame with a column representing the input values and a column with results. This is still experimental and will not work for many input structures.
dtapply(
X,
FUN,
value.names = NULL,
element.name = "element",
fill = TRUE,
as.fun,
...
)
X |
Like for 'lapply()', an object to process (typically a vector or a list). Passed to 'lapply()'. |
FUN |
Function to run for each element in 'X'. Passed to 'lapply()'. |
value.names |
If supplied, setnames will be run on each element returned by lapply wit value.names as the 'new' argument. |
element.name |
What to call the column holding the values or the names of 'X'? Default is "element". What goes into this column depends on the class of 'X'. If 'X' is a character vector, it will be the values of 'X'. If 'X' is a list, it will be the names of the elements in the list. |
fill |
Fill resulting data with 'NA's in order to combine into a single 'data.frame'? Default is TRUE. |
as.fun |
The default is to return data as a data.frame. Pass a function in as.fun to convert to something else. If data.tables are wanted, use 'as.fun="data.table"'. The default can be configured using 'NMdataConf()'. |
... |
arguments passed to lapply |
Only functions that return vectors are currently supported. dtapply should support functions that return data.frames.
a data.table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.