[R] alternative way to replicate()
jholtman at gmail.com
Sun Dec 7 16:32:49 CET 2008
Is this what you want:
> paste(rep('2',5), collapse=',')
On Wed, Dec 3, 2008 at 5:36 AM, Johannes Hüsing <johannes at huesing.name> wrote:
> Am 03.12.2008 um 09:06 schrieb Liviu Andronic:
>> 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)
> JFTR: replicate() is a different function from rep(). See ?rep and
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help