Dear all,

I'm looking for an alternative way to replicate the "2," string for an
x number of times, and end up with one string containing "2," x times.
I can partly achieve this using replicate().
> y <- rep("2,", times=3)
> y
[1] "2," "2," "2,"

The output that I am looking for is, however, "2,2,2,". I also tried
to append(), with similar (unsatisfactory) results.
> z <- for (i in 1:3) {
+ z <- append(z, y[i])}
> z
[1] "2," "2," "2,"

Could anyone suggest how "2," can be replicated to "2,2,2,"?
Thank you,
Liviu




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

______________________________________________
R-help@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.

Reply via email to