[R] String question

baptiste auguie baptiste.auguie at googlemail.com
Wed Dec 23 11:38:53 CET 2009


Will this do?

temp <- paste("m", 1:3, sep="",collapse=",")

HTH,

baptiste

2009/12/23 Knut Krueger <rh at krueger-family.de>:
> Hi to all
>
> I need a string like
> temp <- paste("m1","m2","m3",sep=",")
> But i must know how many items are in the string,afterwards
> the other option would be to use a vector
> temp <- c("m1","m2","m3")
> No problem to get the count of items but I must get afterwards the string
>  "m1,m2,m3"
> No problem to build the string with a loop, but it should be more easy but
> it seems that I am looking to the wrong functions.
>
> Kind regards Knut
>
> ______________________________________________
> 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