Description Usage Arguments Details Value Author(s) Examples
Convert a list of vectors (or data frames) with same numbered lengths (or number of columns) into a data frame.
1 2 |
vList |
List of vectors or data frames, each vector having the
same length, |
col.names |
Optional character vector of length |
row.names |
Optional character vector with length equivalent to
the length of |
convert.numeric |
If |
strings.as.factors |
If |
It is permissible for vList
to contain NULL
elements. list2df
performs numerous consistency checks to
ensure that contents of vList
which are combined into the
resulting data frame
are conformable, labeled consistently, of the equivalent class when
necessary, etc.
If vList
is list of data frames, a data frame resulting from
efficiently row binding
the data frames in vList
is returned. If vList
is a
list of vectors,
a data frame is returned where the first column contains the first elements
of the list vectors, the second column contains the second elements of
the list vectors, etc.
Landon Sego
1 2 3 4 5 6 7 8 9 10 11 12 13 | # For a list of data frames
z <- list(d1 = data.frame(a = 1:10, b = letters[1:10]),
d2 = data.frame(a = 11:15, b = letters[11:15]))
list2df(z)
# For a list of vectors
x <- c("r1c1 1", "r2c1 2", "r3c1 3", "r4c4 4")
y <- strsplit(x, "\ ")
list2df(y)
list2df(y, col.names=LETTERS[1:2])
z <- list(NULL, a = c(top = 10, bottom = 12), NULL, b = c(top = 15, bottom = 17))
list2df(z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.