unlist_df4: Unlist the columns in a data.frame, with more checks, adf,...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/BioGeoBEARS_generics_v1.R

Description

Sometimes, matrices or data.frames will malfunction due to their having lists as columns and other weirdness. This runs unlist and additional checks, and forces conversion to a data.frame at the end. It also adds dfnums_to_numeric which should remove the problem of numbers columns being of class character.

Usage

1

Arguments

df

matrix or other object transformable to data.frame

...

Additional options passed to dfnums_to_numeric.

Details

See especially data.matrix for a possibly simpler alternative.

Value

outdf data.frame

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

See Also

unlist_df, dfnums_to_numeric, cls.df, data.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x = matrix(c(1,2,3,4,5,6), nrow=3, ncol=2)
cls.df(x)
unlist_df4(x)

x = matrix(c(1,2,3,4,5,"A"), nrow=3, ncol=2)
cls.df(x)
unlist_df4(x)

x = adf(matrix(c(1,2,3,4,5,"A"), nrow=3, ncol=2))
names(x) = c("A","B")
cls.df(x)
unlist_df4(x)

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.