powered by
keep_if(x, ..., by = NULL)keep_if_(x, .dots, by = NULL)
keep_if_(x, .dots, by = NULL)
library(data.table) DT <- data.table( id = c(1,2,1), v1 = c(1,NA,2) ) keep_if(DT, v1 == 1) keep_if(DT, v1 == min(v1), by = id)
Run the code above in your browser using DataLab