[R] String question

Knut Krueger rh at krueger-family.de
Wed Dec 23 12:08:02 CET 2009


Jim Lemon schrieb:
>
> Not as easy as I thought it would be, but:
>
> mlist<-as.list(paste("m",1:sample(5:10,1),sep=""))
> do.call("paste",c(mlist,sep=","))
>

Hi Jim,
yes it works  :-)

temp <- c("November", "December","Monday","Tuesday")
length(temp) #getting the length of the vector
string1=do.call("paste",c(as.list(temp),sep=",")) #converting to a string

but I have no idea where I could find that documentation ;-)

Thanks a lot
Knut




More information about the R-help mailing list