splitDF {ThomasJeffersonUniv}R Documentation

Split data.frame by Row

Description

split.data.frame into individual rows.

Usage

splitDF(x)

Arguments

x

data.frame

Value

Function splitDF returns a list of nrow-1 data.frames.

Note

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.

Examples

splitDF(head(mtcars)) # data.frame with rownames
splitDF(head(warpbreaks)) # data.frame without rownames
splitDF(data.frame()) # exception

[Package ThomasJeffersonUniv version 0.1.3 Index]