[R-pkg-devel] vignette issues

Duncan Murdoch murdoch.duncan at gmail.com
Mon Sep 12 21:07:15 CEST 2016


On 12/09/2016 2:01 PM, Bert Gunter wrote:
> Folks:
>
> My stripless package passed all cran checks and built without issues.
>
> But I received the following message from the Windows build:
>
> ---------
> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
> there is no package called ‘lme4'
>
> Quitting from lines 108-111 (stripless_vignette.Rmd)
> Error: processing vignette 'stripless_vignette.Rmd' failed with diagnostics:
> object 'hsb' not found
> Execution halted
> -------------
>
> I do not have any reference to lme4 in my package or vignette. So is this the dependency from the faraway package, which my vignette uses (a couple of its datasets) and which does depend on lme4? If so, do I have to move faraway from my “suggests” to “imports” or “depends, which I read as contrary to what the R extensions manual says. If so, this sounds like a bug to me — why should I be responsible for such dependencies, which could be endless?
>
> 2nd: “hsb” is in the faraway package.  I state specifically in the vignette that the package needs to be installed, and I have the following code in the vignette (using rmarkdown  and knitr):
>
> ```{r, echo = FALSE,message= FALSE }
> if(!require(faraway, quietly = TRUE)){
>   cat("\n, The **faraway** package must be installed to run",
>   "subsequent examples in this vignette.\n",sep = "")
> }
> ```
> I don’t think I should install the package automatically, as this seems an inappropriate intrusion on the user.  I do make the compiled pdf version available in /docs. What is “appropropriate behavior” for me to avoid these warnings?

I agree you shouldn't install anything automatically.  If your vignette 
depends on faraway and it isn't present, I think it's reasonable to fail 
at that point:  use "stop()" rather than just "cat()" for the message.  
Normally Win-builder should have all the mainstream packages installed, 
so this won't be a problem for them, though it might be one for some of 
your users:  but your message should make clear to them what to do to 
fix it.

The message "there is no package called ‘lme4'"suggests things are not 
"normal" on Win-builder.  If this is running under R-devel, that happens 
from time to time.  For example, yesterday I introduced a change that 
contained some errors; it may have caused lme4 to fail (though I hadn't 
noticed that on my system, I wasn't looking for it).  This kind of 
problem is generally inconvenient but at least it is transient.

If you got that error on a version earlier than R-devel, then it's 
probably worth asking about it, perhaps first looking at the CRAN page 
for lme4 to see if there's information there about what might have gone 
wrong.

Duncan Murdoch



More information about the R-package-devel mailing list