Description Usage Arguments Value Author(s) See Also Examples
Convert a data frame to a list, where each element of the output list consists of a named list (or a named vector) containing a single row of the data frame.
1 |
df |
A data frame |
out.type |
Character string uniquely identifying 'list', 'data.frame', or 'vector'. If 'list', then each row of the data frame is output as a list. If 'data.frame', then each row of the data frame is output as a 1-row data frame. If 'vector', then each row of the data frame is output as a named vector. However, for 'vector,' each column of the data set must be the same type. Defaults to 'list'. |
A list where each element consists of a named list, single-row data frame, or a named vector, containing a single row of the original data frame.
Landon Sego
1 2 3 4 5 | d <- data.frame(a = 1:3, b = letters[1:3])
df2list(d)
d1 <- data.frame(a = 1:3, b = 7:9)
df2list(d1, out.type = "v")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.