list2df: Create 'data.frame' from 'list'

Description Usage Arguments Value See Also Examples

Description

Create a data.frame from a list directly, i.e. without being required to explicitly call rbind first.

Usage

1
list2df(x, bind = c("rows", "cols"), ...)

Arguments

x

A list object.

bind

Binding direction. Available options are "rows" (default) and "cols" for rbind and cbind, respectively.

...

Additional arguments passed to data.frame.

Value

A data.frame object.

See Also

data.frame, rbind, cbind.

Examples

1
2
3
4
5
lst <- list(letters[1:3], letters[4:6], letters[7:9])

do.call("rbind", lst) # results in matrix
list2df(lst)          # results in data.frame created using rbind()
list2df(lst, bind = "cols") # same for cbind()

Orcs documentation built on May 2, 2019, 2:37 a.m.