Let's say I had a vector:
remove <- c(17, 18, 19, 20, 24, 25, 30, 31, 44, 45)
.
How do I select / extract every second value in the vector? Like so: 17, 19, 24, 30, 44
I'm trying to use the seq
function: seq(remove, 2)
but it doesn't quite work.
Any help is greatly appreciated.
seq
isseq(start #, end #, interval)
. So sayingseq(remove,2)
is telling R: "start at all the numbers in remove, and count up by the default interval (which is 1) until you get to 2." – Micrometeorite