Thanks a lot.. that is the way to it .


________________________________
 From: Richard M. Heiberger <r...@temple.edu>

Cc: R help <R-help@r-project.org> 
Sent: Thursday, March 22, 2012 7:09 PM
Subject: Re: [R] Create weird type of sequences


rep(1:4, c(1,2,4,8))

rep has additional arguments that might be helpful to you.
?rep




Dear all,
>I would like to create the following sequence of numbers
>1 2 2 3 3 3 3 4 4 4 4 4 4 4 4 and so on (actually I double the number of same 
>elements)....
>
>the reason is that I want then to feed the sequence above to 
>tapply(myVector, weirSeq, FUN = mean)
>
>and then average over those...
>
>Could you please provide some guidance how I can create such a sequence in R?
>
>Regards
>Alex
>
>       [[alternative HTML version deleted]]
>
>
>______________________________________________
>R-help@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.
>
>
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to