[R] How to get all list item to one string variable

Petr Savicky savicky at cs.cas.cz
Thu Jul 12 15:11:59 CEST 2012


On Thu, Jul 12, 2012 at 05:22:45AM -0700, purushothaman wrote:
> hi,
> 
> sorry it's not 2 different list all item in same list like this
> 
> a[1]="abc"
> a[2]="def"
> ...
> output ="abc def ..."

Hi.

Try this

  a <- list("abc", "def", "ghi")
  paste(a, collapse=" ")

  [1] "abc def ghi"

Hope this helps.

Petr Savicky.



More information about the R-help mailing list