I'd like to understand the syntax for elegantly asking R to populate repetitive numbers in a data frame.
I need to count from 1 to 256 64 * 3 times, which I found straightforward enough.
df$Address<-rep(1:256,192)
I need a column to repeat a 1 256*64 rows, then repeat a 3 256*64 rows, then repeat a 5 256*64 rows. I found that one to be intuitive.
df$Gain<-c(rep(1,256*64),rep(3,256*64),rep(5,256*64))
But I can't seem to grasp the syntax for needing to repeat 1 256 times, then 2 256 times, then 3 256 times up to 64 256 times, all 3 times. I wanted something like this to work, but it doesn't:
df$Ref<-rep(rep(1,256):64*3)
What's an elegant way to repeat a number 256 times and then increment that number and repeat?