Hi list, I tried to convert a data.frame into a matrix using data.matrix. Unfortunately my matrix contains missing values (NA) wherefore all columns including NA's were changed into factors.
I thought that many people stumbled across that problem already wherefore there must be a simple solution. But it seems there isn't. I tried lapply, replace and other things in combination but still did not manage to convert my data.frame into a proper matrix with numeric values. Any advice? Cheers -- View this message in context: http://r.789695.n4.nabble.com/convert-data-frame-to-matrix-NA-factor-problem-tp2288828p2288828.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.