-
Notifications
You must be signed in to change notification settings - Fork 642
Description
The book explains why the "Delta" package won't work, even though, at first glance, it does. It repeats the earlier point made, that check() is really important to run often to catch common mistakes.
However, on R 4.5.0, devtools 2.4.5, and rcmdcheck 1.4.0, check() does no longer catch that we are using the tidyverse via library(tidyverse) instead of doing dplyr::mutate() etc.
I did not yet try to go through earlier devtools and rcmdcheck versions to find out where this stopped working, but either way, this part of the book now seems outdated.
I'm also not sure if this change had this as an intended consequence. It now seems even easier to write packages with rookie mistakes in them, since they have become even harder to spot!
Steps to reproduce:
- Download the delta package from here
- Run check()
This gives me this output:
> check()
══ Documenting ════════════════════════════════════════════════════════════════════════════════════════════════
ℹ Installed roxygen2 version (7.3.2) doesn't match required (7.2.3)
✖ `check()` will not re-document this package
══ Building ═══════════════════════════════════════════════════════════════════════════════════════════════════
Setting env vars:
• CFLAGS : -Wall -pedantic -fdiagnostics-color=always
• CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always
• CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
• CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\user\Downloads\r-pkgs-main\package-within-files\delta/DESCRIPTION' (419ms)
─ preparing 'delta':
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts (513ms)
─ checking for empty or unneeded directories
─ building 'delta_0.0.0.9000.tar.gz'
══ Checking ═══════════════════════════════════════════════════════════════════════════════════════════════════
Setting env vars:
• _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE
• _R_CHECK_CRAN_INCOMING_ : FALSE
• _R_CHECK_FORCE_SUGGESTS_ : FALSE
• _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE
• NOT_CRAN : true
── R CMD check ────────────────────────────────────────────────────────────────────────────────────────────────
─ using log directory 'C:/Users/user/AppData/Local/Temp/Rtmpm0lqcx/file46d05ca3419f/delta.Rcheck' (566ms)
─ using R version 4.5.0 (2025-04-11 ucrt)
─ using platform: x86_64-w64-mingw32
─ R was compiled by
gcc.exe (GCC) 14.2.0
GNU Fortran (GCC) 14.2.0
─ running under: Windows 10 x64 (build 19045)
─ using session charset: UTF-8
─ using options '--no-manual --as-cran'
✔ checking for file 'delta/DESCRIPTION'
─ this is package 'delta' version '0.0.0.9000'
─ package encoding: UTF-8
✔ checking package namespace information ...
✔ checking package dependencies (1.3s)
✔ checking if this is a source package ...
✔ checking if there is a namespace
✔ checking for executable files (452ms)
✔ checking for hidden files and directories ...
✔ checking for portable file names
✔ checking serialization versions
✔ checking whether package 'delta' can be installed (4.5s)
✔ checking installed package size ...
✔ checking package directory
N checking for future file timestamps (1m 0.3s)
unable to verify current time
W checking DESCRIPTION meta-information (452ms)
Invalid license file pointers: LICENSE
N checking top-level files
Non-standard file/directory found at top level:
'beach-lookup-table.csv'
✔ checking for left-over files ...
✔ checking index information
✔ checking package subdirectories ...
✔ checking code files for non-ASCII characters ...
✔ checking R files for syntax errors ...
✔ checking whether the package can be loaded ...
✔ checking whether the package can be loaded with stated dependencies ...
✔ checking whether the package can be unloaded cleanly ...
✔ checking whether the namespace can be loaded with stated dependencies ...
✔ checking whether the namespace can be unloaded cleanly (354ms)
✔ checking loading without being on the library search path ...
✔ checking dependencies in R code (474ms)
✔ checking S3 generic/method consistency ...
✔ checking replacement functions ...
✔ checking foreign function calls ...
N checking R code for possible problems (2.7s)
celsify_temp: no visible global function definition for 'mutate'
celsify_temp: no visible global function definition for 'if_else'
celsify_temp: no visible binding for global variable 'english'
celsify_temp: no visible binding for global variable 'temp'
localize_beach: no visible global function definition for 'read_csv'
localize_beach: no visible global function definition for 'cols'
localize_beach: no visible global function definition for 'left_join'
Undefined global functions or variables:
cols english if_else left_join mutate read_csv temp
W checking for missing documentation entries ...
Undocumented code objects:
'celsify_temp' 'localize_beach' 'outfile_path'
All user-level objects in a package should have documentation entries.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
─ checking examples ... NONE
✔ checking for non-standard things in the check directory
✔ checking for detritus in the temp directory
See
'C:/Users/user/AppData/Local/Temp/Rtmpm0lqcx/file46d05ca3419f/delta.Rcheck/00check.log'
for details.
ERROR: Unknown command "TMPDIR=C:/Users/user/AppData/Local/Temp/RtmpoLDWzB/file2ca81852c6a". Did you mean command "install"?
Warning message:
In system2("quarto", "-V", stdout = TRUE, env = paste0("TMPDIR=", :
running command '"quarto" TMPDIR=C:/Users/user/AppData/Local/Temp/RtmpoLDWzB/file2ca81852c6a -V' had status 1
── R CMD check results ────────────────────────────────────────────────────────────────── delta 0.0.0.9000 ────
Duration: 1m 14.4s
❯ checking DESCRIPTION meta-information ... WARNING
Invalid license file pointers: LICENSE
❯ checking for missing documentation entries ... WARNING
Undocumented code objects:
'celsify_temp' 'localize_beach' 'outfile_path'
All user-level objects in a package should have documentation entries.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
❯ checking for future file timestamps ... NOTE
unable to verify current time
❯ checking top-level files ... NOTE
Non-standard file/directory found at top level:
'beach-lookup-table.csv'
❯ checking R code for possible problems ... NOTE
celsify_temp: no visible global function definition for 'mutate'
celsify_temp: no visible global function definition for 'if_else'
celsify_temp: no visible binding for global variable 'english'
celsify_temp: no visible binding for global variable 'temp'
localize_beach: no visible global function definition for 'read_csv'
localize_beach: no visible global function definition for 'cols'
localize_beach: no visible global function definition for 'left_join'
Undefined global functions or variables:
cols english if_else left_join mutate read_csv temp
0 errors ✔ | 2 warnings ✖ | 3 notes ✖
I actually do not see any reference of what is mentioned in the book at all!
* installing *source* package ‘delta’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in library(tidyverse) : there is no package called ‘tidyverse’
Error: unable to load R code in package ‘delta’
Execution halted
ERROR: lazy loading failed for package ‘delta’
* removing ‘/Users/jenny/rrr/delta.Rcheck/delta’