I have some below code that I feel could be sped up by going about it differently.
df1leadupdate <- subset(df1, (glm==1)) df1leadcheck <- subset(df1, (glm==0)) df1insert <- subset(df1leadcheck, !(ID %in% df1leadupdate$ID)) df1insert <- unique(df1insert, by = "ID")
Basically I have a table, split it based on the models findings and then say if it's in this table, it can't be in that table. At the end, I then just grab the unique rows. Is there a 'data.table' way of doing the same thing?