In R, I need to create a vector in which the values appear in order, starting with 1, in which each value is duplicated once, as shown below:
v <- c(1,1,2,2,3,3,4,4,5,5)
and so on.
The above vector has five pairs, but the number of pairs can be many more.
How can I do that without having to manually type every pair?