as.list.numdfr: Coerce to list

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

Description

Function to coerce to R lists.

Usage

1
2
## S3 method for class 'numdfr'
as.list(x, returnFactors=TRUE, ...)

Arguments

x

numdfr object to coerce

returnFactors

if TRUE (the default), return columns that represent factors as factors. If not, they are returned as numerical vectors.

...

ignored for now, but see as.list

Details

Often used internally by e.g. lapply. This function is not expected to perform swiftly, so use with caution. Mainly provided so code can be shared (at the cost of performance) with data.frame.

See as.list.data.frame for more explanation on how this function is supposed to work. It is not extensively tested, but appears to work in the lapply case.

Value

list consisting of the columns (either numerical or as factors), similar (equal?) to this method for data.frame.

Author(s)

Nick Sabbe

See Also

NumDfr, as.list, as.list.data.frame

Examples

1
2
3
4
iris.nd<-numdfr(iris)
lapply(iris, is.factor) 
lapply(iris.nd, is.factor) #should give the same result
lapply(as.list(iris.nd, returnFactors=FALSE), is.factor) #should give different result (all FALSE)

NumDfr documentation built on May 2, 2019, 5:50 p.m.