[R] 2D array of strings

Francesco Napolitano franapoli at gmail.com
Mon Dec 28 22:32:47 CET 2009


Sorry for the dumb question, but I couldn't figure this out myself.

Consider the following:

> str <- c("abc","def")
> array(str, c(2,1))
     [,1]
[1,] "abc"
[2,] "def"

How can i obtain the outcome of the second instruction without
specifying the number of rows?

Thank you in advance,
Francesco.




More information about the R-help mailing list