Is there a \"by row\" operation in R to convert each row in a vector like this to strings?
> d= cbind(\"Data\", c(\"2\", \"73\")) > d [,1] [,2]
Yes, there is. It is called "apply" ;-)
apply(d,1,paste,collapse=" ") [1] "Data 2" "Data 73" # convert to matrix using as.matrix to get exactly your solution
See ?apply and ?paste
?apply
?paste