Is there a function to generate a sequence of integers in R where each integer is repeated a predefined number of times?
Example:
# 1 repeated twice, 2 repeated 5 times, 3 repeated 4 times and so on
1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3
I know the following function but it does not serve the purpose:
rep(1:5, each=3)