asNumMatrix: Convert string-valued data frame or matrix into a numeric...

Description Usage Arguments Value Author(s) Examples

View source: R/dfmat.R

Description

Convert string-valued data frame or matrix into a numeric matrix

Usage

1

Arguments

x

A data.frame or matrix, most likely with string values

Value

A numeric matrix with the same dimension

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples

1
2
3
4
5
testDf <- data.frame(a=c("2.34", "4.55"), b=c("7.33", "9.10"))
asNumMatrix(testDf)

testMatrix <- matrix(c("2.34", "4.55", "9E-3","-2.44", "7.33", "9.10"), nrow=2)
asNumMatrix(testMatrix)

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.