splitDF | R Documentation |
split.data.frame into individual rows.
splitDF(x)
x |
data.frame |
Function splitDF returns a list of nrow-1 data.frames.
We use split.data.frame with argument f
being attr(x, which = 'row.names', exact = TRUE)
instead of
seq_len(.row_names_info(x, type = 2L))
,
not only because the former is faster, but also .rowNamesDF<- enforces
that row.names.data.frame must be unique.
splitDF(head(mtcars)) # data.frame with rownames
splitDF(head(warpbreaks)) # data.frame without rownames
splitDF(data.frame()) # exception
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.