I have a matrix with: character elements.
sapply(mat,class) "character"
I would like to apply rowSums to this matrix, but I get an error:
Error in rowSums(mat) : 'x' must be numeric
If I do as.numeric (mat), then I get a vector.
Is there a way to change from character to numeric, but keep the matrix structure?
source share