I have a data.table with 2.7 million observations and 21 variables and need to produce a new data.table in which Variable 1 matches a vector of values.
I have vector of values that match with some of Variable1 values, like the following
VectorValue= (A, B, XXZ, UDD...)
I was thinking of something like:
Table_B <- Table_A[Table_A$Variable1 == VectorValue]
or
Table_B <- Table_A[Variable1 == VectorValue]
but I get this error:
When i is a data.table (or character vector), the columns to join by must be specified either using 'on=' argument (see ?data.table) or by keying x (i.e. sorted, and, marked as sorted, see ?setkey). Keyed joins might have further speed benefits on very large data due to x being sorted in RAM.