Suppose I have vector a:
c(1, 6, 2, 4.1, 1, 2)
And a count vector b:
c(2,3,2,1,1,0)
I’d like to generate vector c:
c(1, 1, 6, 6, 6, 2, 2, 4.1, 1)
To call:
hist(c)
How can I build c, or is there a way to generate the histogram directly from a and b? Note the duplicates in a, as well as unequal spacing.
Require a vectorized solution. a and b are too large for lapply and friends.
?repEdit since I was curious!