Thanks again for your quick reply. I understood your procedure but now it is even more strange why my conversion does not work. In your example, the NA values are in "brackets" <NA> and what your procedure does is to convert these <NA> values into NA and then it seems to be possible to use data.matrix to correctly convert the data.frame into a data.matrix. But the data I read into R are already in that form that the NA values are displayed as NA rather than <NA>. So the conversion should actually work.
Cheers -- View this message in context: http://r.789695.n4.nabble.com/convert-data-frame-to-matrix-NA-factor-problem-tp2288828p2289022.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.