I have a vector of unique elements that I want to replicate a variable number
of times depending on the element (lengths all > 800).  However I noticed
that the resulting length was not the sum of the each argument.  The
following example demonstrates this. 

I am confused as to why this works: 

rep(1:4, c(2,1,2,1)) 
[1] 1 1 2 3 3 4 

but this doesn't: 

rep(1:3, each=c(2,1,2)) 
[1] 1 1 2 2 3 3 

This does not appear to be consistent with the description provided in
?rep....   
Is this supposed to be happening? 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/each-argument-in-rep-Bug-tp3253050p3253050.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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