Displaying 1 result from an estimated 1 matches for "subsettin".
Did you mean:
subsetting
2010 Nov 05
4
subsets, %in%
Hi,
I have a question about %in% and subsettin data frames.
Say I need to keep ID 1,2,4,5, 10 from the data frame dat. I can do:
dat <- data.frame(ID = 1:10, var = 1:10)
someID <- c(1,2,4,5,10)
subset(dat, dat$ID %in% someID)
Is there a quick way to do the opposite, ie to do a subset that contains
all ID but someID? Something like %n...