powered by
Convert string-valued data frame or matrix into a numeric matrix
asNumMatrix(x)
A numeric matrix with the same dimension
A data.frame or matrix, most likely with string values
Jitao David Zhang <jitao_david.zhang@roche.com>
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)
Run the code above in your browser using DataLab