I have a data frame taken from a .csv-file which contains numeric and character values. I want to convert this data frame into a matrix. All containing information is number
I had the same problem and I solved it like this, by taking the original data frame without row names and adding them later
SFIo <- as.matrix(apply(SFI[,-1],2,as.numeric)) row.names(SFIo) <- SFI[,1]