title: Data anonymization in R
body: <p>I was trying to run the below code to mask the data in 2 columns, but failing with below error:</p>
  
  <pre><code>setwd("/cloud/project/CX")
  
  Credit_tbl &lt;-read.csv(file = 'Sample_data.csv',sep = ",",stringsAsFactors = FALSE)
  
  anonymize &lt;- function(x, algo="crc32"){
    unq_hashes &lt;- vapply(unique(x), function(object) digest(object, algo=algo), FUN.VALUE="", USE.NAMES=TRUE)
    unname(unq_hashes[x])
  }
  
  cols_to_mask &lt;- c("Email","Phone")
  
  Credit_tbl[,cols_to_mask := lapply(.SD, anonymize),.SDcols=cols_to_mask,with=FALSE]
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Error in <code>[.data.frame</code>(Credit_tbl, , <code>:=</code>(cols_to_mask, lapply(.SD,
    anonymize)),  :    unused arguments (.SDcols = cols_to_mask, with =
    FALSE)</p>
  </blockquote>