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

arun smartpink111 at yahoo.com
Thu Jul 12 14:42:00 CEST 2012


Hi,

If I understand it correctly, probably this is what you want:
a<-list("abc","def","ghi")
 a1<-unlist(a)
 paste(a1[1],a1[2],a1[3],sep=" ")
[1] "abc def ghi"


A.K.



----- Original Message -----
From: purushothaman <purushothaman.b at ge.com>
To: r-help at r-project.org
Cc: 
Sent: Thursday, July 12, 2012 8:22 AM
Subject: Re: [R] How to get all list item to one string variable

hi,

sorry it's not 2 different list all item in same list like this

a[1]="abc"
a[2]="def"
...
output ="abc def ..."

Thanks
B.Purushothaman

--
View this message in context: http://r.789695.n4.nabble.com/How-to-get-all-list-item-to-one-string-variable-tp4636283p4636287.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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