1
votes

I am trying to push the following package to CRAN, but I keep getting an error on the check.

Error:

✓  checking R/sysdata.rda ...
    WARNING
   ‘qpdf’ is needed for checks on size reduction of PDFs
✓  checking installed files from ‘inst/doc’ ...
✓  checking files in ‘vignettes’ ...
E  checking examples (3s)
   Running examples in ‘oRus-Ex.R’ failed
   The error most likely occurred in:
   
   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: analyseStories
   > ### Title: Analysing Stories
   > ### Aliases: analyseStories
   > 
   > ### ** Examples
   > 
   > # Transform the stories
   > fileUrl <- example_stories()
   > stories <- analyseStories(fileUrl, 7)
   Joining, by = "word"
   Joining, by = "word"
   Error in loadNamespace(name) : there is no package called ‘reshape2’
   Calls: analyseStories ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
   Execution halted

Current problems:

  • The example is in orus::analyseStores(...) function.
  • The example actually runs and works on the pkgdown website.
  • The error appears only when doing devtools::check

I have tried multiple things:

I have run out of options. Any idea of what is happening?

1
Why was it bounced by a person? - Axeman
Every user should be able to run the examples without error, but you are loading a package they might not have. You'd need a dontrun. - Axeman
I'm a bit confused why you need to load reshape2 for that example. - Axeman
It sounds to me that the example that you can't run is just a symptom, but not the root of the issue here. But rather, you have a deeper issue with dependencies not working as they should. - Axeman
Try adding reshape2 to Suggests. I had similar issue today when using sjlabelled::read_spss in my package. When checking via ´devtools::check` both in my examples and my tests I got an error that haven is needed for this function. After adding haven to Suggests both the examples and the tests passed. - stefan

1 Answers

0
votes

As @stefan suggested in the comments, I had to add reshape2 into the Suggested packages in the description file. I added using:

usethis::usepackage("reshape2", "Suggests")

Followed by regenerating the docs:

devtools:document()

Package is on its way to CRAN!