A new R CMD CHECK Note was introduced when I upgraded to R 4.2.0, but I could not find in the R changelog what happened. I am getting

❯ checking dependencies in R code ... NOTE
  Namespaces in Imports field not imported from:
    ‘DBI’ ‘RSQLite’ ‘assertthat’ ‘cli’ ‘dbplyr’ ‘rlang’ ‘stringr’ ‘tidyr’
    All declared Imports should be used.

I am using functions from these packages for the methods of my RC class. Previously, in R 4.1.3 this note did not appear. I am a little reluctant to add @import tags for all these packages. What is the current practice now for importing functions for RC methods?

It is probably because you create the class at install time, and the check does not consider code that runs at install time.

A workaround is to create a dummy function that refers to these packages:

dummy <- function() {
  cli::cli_alert
  stringr::str_replace
  ...
}

Silly, but this satisfies the check.

2 Likes

Thanks @Gabor I can use this dummy function, just wondering if anyone else has come across this and if there's going to be a long-term solution?