splitDF: Split data.frame by Row

View source: R/splitDF.R

splitDFR 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

ThomasJeffersonUniv documentation built on July 3, 2024, 5:08 p.m.