I have a data frame full of integer values. I need a matrix full of numeric values.
?data.matrix reads: Return the matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix. This does not work. test.df <- data.frame(a=as.integer(c(1,2,3)), b=as.integer(c(4,5,6))) > class(test.df[[1,1]]) [1] "integer" > class(data.matrix(test.df)[[1]]) [1] "integer" What's going on here? ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.