I have a data frame with dimensions 3695 X 20. The first column contains alphanumeric identifiers, the other 19 columns are all numeric. So, rownames(df) provides the numbers 1-3695, and colnames(df) gives the names of the columns. df[,1] provides the alphanumeric identifiers.
I would like to convert the data frame to a matrix and use column 1 of the existing data frame to be the rownames of the new matrix and maintain the column names of the data frame as the column names of the matrix.
I would also like to automate this process for use with data frames of similar but different dimensions. So, if the solution to this requires knowing the number of rows and/or columns, how can I get this information into the code without me having to look at the monitor ?
I have looked at data.matrix and reshape2 but can not seem to figure out how to do what I want.