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

Ivan Calandra ivan.calandra at u-bourgogne.fr
Thu Jul 12 15:09:36 CEST 2012


Hi,

What you did is equivalent to, but more complicated (and slower as well 
I guess) than:
paste(a, collapse="")

Ivan

--
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
+33(0)3.80.39.63.06
ivan.calandra at u-bourgogne.fr
http://biogeosciences.u-bourgogne.fr/calandra



Le 12/07/12 14:54, arun.gurubaramurugeshan a écrit :

Try this...

a<-c("abc","def","ghi","klm","nop","qrs","tuv","wxyz")
b<-data.frame()
for (i in 1:length(a)){
b<-paste(b,a[i],sep="")
}
print(b)


Thanks
Arun
---



More information about the R-help mailing list