as.nummatrix: Convert 'object' to 'numeric matrix'

Description Usage Arguments Value Author(s) See Also Examples

Description

Functions to coerce object to numericmatrix.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'numdfr'
as.nummatrix(object)
## S3 method for class 'numdfr.rep'
as.nummatrix(object)
## S3 method for class 'matrix'
as.nummatrix(object)
## S3 method for class 'data.frame'
as.nummatrix(object)

Arguments

object

object to coerce

Value

matrix with the same dimensions as the original object, and with factors converted to numericals. Have not always checked what happens to characters...

Author(s)

Nick Sabbe

See Also

NumDfr, as.matrix

Examples

1
2
3
4
5
iris.nd<-numdfr(iris)
iris.mat<-as.nummatrix(iris.nd)
iris.mat2<-as.nummatrix(iris)
#compare this to
iris.mat3<-as.matrix(iris) #becomes all character!

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