Last data update: 2014.03.03

R: Unlist the columns in a data.frame
unlist_dfR Documentation

Unlist the columns in a data.frame

Description

Sometimes, matrices or data.frames will malfunction due to their having lists as columns and other weirdness. This is a shortcut for data.frame(lapply(df, function(x) unlist(x))).

Usage

  unlist_df(df)

Arguments

df

matrix or other object transformable to data.frame

Value

data.frame

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

See Also

unlist_df2

Examples

df = adf(matrix(c(1,2,3,4,5,6), nrow=3, ncol=2))
df2 = unlist_df(df)
df2

Results