lintr no visible binding for global variable ‘.SD’

623 views Asked by At

lintr throws error while using data.table functions like .SD, .SDcols, e.g:

/path/readData.R:130:29: warning: no visible binding for global variable ‘.SD’, Did you mean 'SSD'?
      DT[, "row.sum" := rowSums(.SD), .SDcols =  names(DT)]
                                ^~~

How can I fix this?

1

There are 1 answers

1
mlevy On

Add linters: with_defaults(object_usage_linter = NULL) to your .lintr file.