In R, you can use a logical vector whose length is the container to select off the elements you want. (i.e. c(1,2,3,4)[c(True,False)] yields c(1,3). See http://www.r-tutor.com/r-introduction/vector/logical-index-vector