unlist_df: Unlist the columns in a data.frame

Description Usage Arguments Value Author(s) See Also Examples

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

1

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

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

Example output

Loading required package: date
Loading required package: sp
Loading required package: sfsmisc
Loading required package: raster
Loading required package: rgdal
rgdal: version: 1.2-10, (SVN revision 673)
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 1.10.1, released 2013/08/26
 Path to GDAL shared files: /usr/share/gdal/1.10
 Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
 Path to PROJ.4 shared files: (autodetected)
WARNING: no proj_defs.dat in PROJ.4 shared files
 Linking to sp version: 1.2-3 
  V1 V2
1  1  4
2  2  5
3  3  6

modiscloud documentation built on May 2, 2019, 5:16 a.m.