I have a relatively large data.table (around 1 billion rows, and 30 columns), and am trying to subset it to remove some categories I'm not interested in. The category
variable is a factor with around 30 labels. However, when I do this my session is consistently killed. Is there a way to subset a data.table in place?
Given my data.table is dt
, the line in question which causes the crash is:
dt <- dt[!category %in% c('f', 'g')]
Any suggestions for how to avoid this issue? Apologies for the lack of a reproducible example, it's obviously difficult with this scale of data. I'm using R version 3.6.1 and data.table version 1.12.9.