Hi I want to convert a matrix to a dataframe.
The matrix is like this Site A B C D X 1 2 3 4 Y 5 6 7 8 Z 9 10 11 12 The converted dataframe need to have the first row as column names and the values of each column (1, 2, 3, 4; ......12;) be numeric, not factors. I used data.frame(), but it gave me auto-assigned column names (like X1, X2, X3, X4) and put the alphabet and numbers together as factors of each column. Is there a way to correct it? Thank you -- View this message in context: http://www.nabble.com/How-to-convert-a-matrix-to-a-dataframe-and-makes-its-first-row-be-the-column-name-tp24650062p24650062.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.