[R] to calculate c(rep("1", 43), rep("2", 43), ...., rep("10", 43))

Ivan Calandra ivan.calandra at univ-reims.fr
Thu Dec 11 11:38:05 CET 2014


Hi Michel,

What about
rep(1:10, each=43)

If you need to have characters, you could do something like: 
as.character(1:10)

HTH,
Ivan

--
Ivan Calandra, ATER
University of Reims Champagne-Ardenne
GEGENA² - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calandra at univ-reims.fr
https://www.researchgate.net/profile/Ivan_Calandra

Le 11/12/14 11:12, Arnaud Michel a écrit :
> 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
>



More information about the R-help mailing list