Friday 27 September 2013

How do I get all rows of a dataframe NOT designated in a vector in R?

How do I get all rows of a dataframe NOT designated in a vector in R?

I'm looking for an elegant, R-like way to capture rows in a dataframe that
don't have their indices listed in a vector:
table.combos <- matrix(data = 1:12, nrow = 10, ncol = 6, byrow=T)
table.combos
not.these<-c(2,4,5,9)
x<-table.combos[c(not.these),]
#y<- everything not in x

No comments:

Post a Comment