dataframe - Removing rows of data in R -


what's reliable way remove matching ids 2 large data frames in large?

for example, have list of participants not want contacted (n=200). remove them dataset of on 100 variables , 200,000 observations.

this list of 200 participants ids need remove dataset.

exclude=read.csv("/home/project/file/excludeids.csv", header=true, sep=",")  dataset.exclusion<- dataset[-which(exclude$participantid %in% dataset$participantid  ), ]   

is correct command use?

i don't think command doing want, because when verify following: length(which(dataset.exclusion$participantid %in% exclusion$participantid)) don't 0.

any insight?

you can example:

sample1[!sample1$participantid %in%              unique(exclusion$participantid),] 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -