[R] 2D array of strings

Tony Plate tplate at acm.org
Mon Dec 28 23:08:43 CET 2009


matrix(str, ncol=1)

Francesco Napolitano wrote:
> 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.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list