[R] Sequence generation

RIOS,ALFREDO ARTURO arios at ufl.edu
Sat Aug 29 21:21:25 CEST 2009


I think should work

rep(c(1,2,3),10)


Alfredo


On Sat Aug 29 15:14:15 EDT 2009, njhuang86 <njhuang86 at yahoo.com> 
wrote:

> 
> Hey guys,
> 
> I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 
> 2, 3, 1,
> 2, 3... with the '1, 2, 3' repeated over 10 times.
> 
> Also, is there a simple method to generate 1, 1, 1, 2, 2, 2, 3, 
> 3, 3?
> 
> Anyways, any help with be greatly appreciated!
> -- View this message in context: 
> http://www.nabble.com/Sequence-generation-tp25205593p25205593.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.
> 
> 



--
RIOS,ALFREDO ARTURO




More information about the R-help mailing list