I'm trying to convert a matrix which has 46 columns and 28 rows to num, see below:
chr [1:28, 1:46] "12.96720" "10.31482" "10.61680" "11.13120"
"10.48705" " 9.525684" " 9.942551" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:28] "BPWG " "BWBG" "GGGW" "GGPB" ...
..$ : NULL
However, so far when I do it the matrix loses all shape and essentially I get a list. I tried:
lapply(ggg2,function(x) as.numeric(as.character(x)))
How can I convert it so it retains the 46 columns and 28 rows?
Thanks