I have a vector,
x<-c(1,3,2,3,1,4,2,1,3,4,2,1,0,2,4,5,2,1,2)
I would like to obtain a vector of x by not including one every other time starting from the first element up to the 10th element. This will be to include elements (1,3,5,7 and 9 of x) to obtain (1,2,1,2,3). In line with the below expression which produces an error.
x[1:10,by=2]
Thank you