immunomind / immunarch

🧬 Immunarch: an R Package for Fast and Painless Exploration of Single-cell and Bulk T-cell/Antibody Immune Repertoires
https://immunarch.com
Apache License 2.0
311 stars 66 forks source link

Move data.table to Imports: #404

Open MichaelChirico opened 7 months ago

MichaelChirico commented 7 months ago

Depends are discouraged for data.table:

https://github.com/Rdatatable/data.table/issues/3076

(in fact, we hope that R will eventually deprecate this mode of dependency)

I used {lintr} to find all {data.table} usages in your package.

dt_exports <- getNamespaceExports("data.table")
dt_functions <- grep("^[a-zA-Z]", dt_exports, value=TRUE)
dt_operators <- grep("^[%]", dt_exports, value=TRUE)
lintr::lint_package(linters = list(
  lintr::undesirable_function_linter(setNames(nm = dt_functions)),
  lintr::undesirable_operator_linter(setNames(nm = dt_operators))
))

I added some qualifications of functions like melt() and first() that are also exported also by data.table to clarify their source, but could revert this if seen fit.

The qualifications in tests are needed as {data.table} is no longer attached for those.