list2DF | R Documentation |
Create a data frame from a list of variables.
list2DF(x = list(), nrow = NULL)
x |
A list of variables for the data frame. |
nrow |
An integer giving the desired number of rows for the data frame, or
|
Note that all list elements are taken “as is” (apart from possibly replicating to the same length).
A data frame with the given variables.
data.frame
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.