I want to paste cells of matrix together, But when I do paste(),It returns a vector. Is there a direct function for same in R?
mat <- matrix(1:4,2,2) past
Or use sprintf withdim<-
sprintf
dim<-
`dim<-`(sprintf('%d,%d', mat, mat), dim(mat)) # [,1] [,2] #[1,] "1,1" "3,3" #[2,] "2,2" "4,4"