title: Delete rows conditionally in data table
body: <p>I have a large dataset with several rows that include multiple customerIDs as follows.</p>
  <p><strong>DT</strong></p>
  <pre><code>|customerID | V1| V2 | 
  |:---------:|:---:|:------:|
  |A| 24| RT|
  |A| 56| ES|
  |B| 42| GS|
  |B| 43| XC|
  |B| 46| XZ|
  |C| 42| GE|
  |C| 25| WD|
  |D| 34| XZ|
  |D| 19| RF|
  |E| 19| DW|
  |E| 37| XS|
  |F| 44| ZS|
  |G| 23| AA|
  </code></pre>
  <p>I want to delete rows with certain customerIDs (e.g. A, C, E) so that it looks like this:</p>
  <p><strong>DT</strong></p>
  <pre><code>|customerID | V1| V2 | 
  |:---------:|:---:|:------:|
  |B| 42| GS|
  |B| 43| XC|
  |B| 46| XZ|
  |D| 34| XZ|
  |D| 19| RF|
  |F| 44| ZS|
  |G| 23| AA|
  </code></pre>
  <p>I know one way to do it is to use the following method:</p>
  <pre><code>dt1 &lt;- dt[customerID != A &amp; customerID != C &amp; customerID != E]
  </code></pre>
  <p>However, because my actual dataset contains several customerIDs, I want to find a more efficient way instead.</p>
  <p>My goal was to create a vector with the customerIDs I want to exclude as follows:</p>
  <pre><code>exclude &lt;- c(A, C, E)
  </code></pre>
  <p>Then use the vector to conditionally remove the customerIDs:</p>
  <pre><code>dt1 &lt;- dt[customerID != exclude]
  </code></pre>
  <p>However, when I run this in R, nothing in the table changes.</p>
  <p>Any assistance would be appreciated.</p>