In my simulation, I need a vector that looks like this:
vec = NULL NULL NULL NULL 2 2 2 2 4 4 4 4
However, in R, when I use rep(NULL, 4) , it does not return anything. For instance,
vec.all = c(rep(NULL, 4), rep(2, 4), rep(4, 4)) vec.all 2 2 2 2 4 4 4 4
Is there a way to repeat NULL several times in R? Thanks!
source share