Hello,

Try the following.

unlist(lapply(1:10, function(n) rep(as.character(n), 43)))

Hope this helps,

Rui Barradas

Em 11-12-2014 10:12, Arnaud Michel escreveu:
Hello
I would like to find an elegant way of calculating
c(rep("1", 43), rep("2",43),...., rep("10",43))

Any idea ?
Thank you


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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