CRAN submission check failure

devtools::check(), fails in R Studio Check and works in the Console.

Failure:

devtools::check()
Updating cartools documentation
Writing NAMESPACE
Error in get(name, envir = env) : use of NULL environment is defunct
Calls: <Anonymous> ... block_find_object -> object_from_call -> find_data -> get
Execution halted
Exited with status 1.

Success:

devtools::check()
Duration: 38.2s
0 errors :heavy_check_mark: | 0 warnings :heavy_check_mark: | 0 notes :heavy_check_mark:

Background

I had no problem with this command using the R Studio Check command until I changed Author to Authors@R in the DESCRIPTION.

I have a work around that I stumbled on. Apparently, there is a bug in R Studio that should be addressed.

What exactly does your Authors@R field look like? I was under the understanding that it must be valid R code. So if you changed the field name but not the values, it would throw an error.

For instance,

Authors@R: person("a", "person", email = "aperson@mail.com", role = c("aut", "cre"))

I don’t think this is a bug in RStudio — I think this is a bug in roxygen2

Was actually a devtools bug: https://github.com/r-lib/devtools/pull/1849. Should be in the dev version soon.