On this page
list2DF
Create Data Frame From List
Description
Create a data frame from a list of variables.
Usage
list2DF(x = list(), nrow = NULL)
Arguments
x |
A list of variables for the data frame. |
nrow |
An integer giving the desired number of rows for the data frame, or |
Details
Note that all list elements are taken “as is” (apart from possibly replicating to the same length).
Value
A data frame with the given variables.
See Also
Examples
## Create a data frame holding a list of character vectors and the
## corresponding lengths:
x <- list(character(), "A", c("B", "C"))
n <- lengths(x)
list2DF(list(x = x, n = n))
## Create data frames with no variables and the desired number of rows:
list2DF()
list2DF(nrow = 3L)
Copyright (©) 1999–2012 R Foundation for Statistical Computing.
Licensed under the GNU General Public License.