When running devtools::check()
, my package builds with an error that I cannot pinpoint. What debugging options are available when creating R packages? I am looking for something along the lines of browser()
on error.
The error is thrown due to an internal package variable that cannot be found. The variable is called 'hg19' and is stored in sysdata.rda.
── R CMD check ─────────────────────────────────────────────────────────────────
─ using log directory ‘/private/var/folders/md/4bf5wym92vsgqfbl4457psw40000gn/T/RtmpgCtpaV/mypackage.Rcheck’
─ using R version 3.6.0 (2019-04-26)
─ using platform: x86_64-apple-darwin15.6.0 (64-bit)
─ using session charset: UTF-8
─ using options ‘--no-manual --as-cran’ (575ms)
✔ checking for file ‘mypackage/DESCRIPTION’
─ this is package ‘mypackage’ version ‘0.0.0.9000’
─ package encoding: UTF-8
✔ checking package namespace information
✔ checking package dependencies (5.9s)
✔ checking if this is a source package
✔ checking if there is a namespace
✔ checking for executable files ...
✔ checking for hidden files and directories
✔ checking for portable file names
✔ checking for sufficient/correct file permissions ...
E checking whether package ‘mypackage’ can be installed (11.5s)
Installation failed.
See ‘/private/var/folders/md/4bf5wym92vsgqfbl4457psw40000gn/T/RtmpgCtpaV/mypackage.Rcheck/00install.out’ for details.
See
‘/private/var/folders/md/4bf5wym92vsgqfbl4457psw40000gn/T/RtmpgCtpaV/mypackage.Rcheck/00check.log’
for details.
── R CMD check results ──────────────────────────────── mypackage 0.0.0.9000 ────
Duration: 18.8s
❯ checking whether package ‘mypackage’ can be installed ... ERROR
See below...
── Install failure ─────────────────────────────────────────────────────────────
* installing *source* package ‘mypackage’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error in get(genome) : object 'hg19' not found
Error: unable to load R code in package ‘mypackage’
Execution halted
ERROR: lazy loading failed for package ‘mypackage’
* removing ‘/private/var/folders/md/4bf5wym92vsgqfbl4457psw40000gn/T/RtmpgCtpaV/mypackage.Rcheck/mypackage’
1 error ✖ | 0 warnings ✔ | 0 notes ✔