alternative way to replicate()
Thanks all. All solutions are usable. These two I received off-list:
toString(paste(rep("2",3), sep=","))
[1] "2, 2, 2" and
paste(rep("2,",3),collapse="")
Liviu On Wed, Dec 3, 2008 at 9:14 AM, Dimitris Rizopoulos
<d.rizopoulos at erasmusmc.nl> wrote:
have a look at ?paste(), e.g., paste(rep(2, 3), collapse = ",") and if you need a comma at the end, then you can again use paste(), paste(paste(rep(2, 3), collapse = ","), ",", sep = "")