R CMD CHECK Failing Vignette Erroring

Hi All,

So I've been trying to set up package checks on my github package but running into issues. Basically the package is erroring during the checks with following error:

Error: --- re-building ‘Cell_Bender_Functions.Rmd’ using rmarkdown
Quitting from lines 48-54 (Cell_Bender_Functions.Rmd) 
Error: Error: processing vignette 'Cell_Bender_Functions.Rmd' failed with diagnostics:
there is no package called 'tidyverse'
--- failed re-building ‘Cell_Bender_Functions.Rmd’

Basically failing because can't find tidyverse because to minimize explicit package dependencies I don't list tidyverse but use that example and my vignettes. I have tried setting Project options so that the checks don't build the vignettes (see image)Project Options
but even then it still seems to attempt to build the vignettes and errors at the same place. Am I missing something? Apologies if this is simple answer but having trouble finding exact issue in this or other forums.

Thank you,
Sam

Did you use

Suggests: tidyverse

? If you don't use tidyverse at least as a Suggests dependency, then it won't be available in R CMD check.

Btw. if you show use your package, then can probably do better than guessing.

2 Likes

Hi @Gabor,

Thanks so much for quick reply! And sorry meant to include link but forgot, package is here: GitHub - samuel-marsh/scCustomize: Collection of functions created and/or curated to aid in the visualization and analysis of single-cell data using R..

Yes I actually just figured out the Suggests solution now actually but have run into 1 other kinda related issue. I have some local files which are used to build vignettes and create pkgdown website. The site builds with no issues. But the rcmdcheck is erroring with:
Failed to open assets/marsh_2020_micro.qs. Check file path.

Since I have pkgdown site which checks the vignettes when I do the build_site I would simply like to exclude the vignette rebuild during the check. Is there way to specify that which I'm missing? I thought specifying things in Project options (see image in original post) would do it but apparently not?

Thanks!!
Sam

In general it might be good to ensure the code in vignettes is covered by "actual" tests. Another strategy is used for the tibble package where's there's a snapshot test of a vignette tibble/galley.R at eac1191b62b27663091deb1a5edc016c6a5b0c7c · tidyverse/tibble · GitHub (might not always be fun to debug though).

@maelle Thanks so much for reply!!

I think precomputing is best approach because couple of them also rely on local data files or data packages that are installed from other packages so easiest to precompute locally.

I'll give that try and see if it solves the issues.

1 Like

Hi @maelle

So I followed idea of renaming .Rmd with .orig at the end and then knitting locally. I did just for a two of the vignettes to start just to make sure everything looks ok. But I'm now getting earlier error during the build step in the check:

  Failed to build source package 'scCustomize', stdout + stderr:
  
  OE> * installing *source* package ‘scCustomize’ ...
  OE> staged installation is only possible with locking
  OE> ** using non-staged installation
  OE> ** R
  OE> ** data
  OE> *** moving datasets to lazyload DB
  OE> ** byte-compile and prepare package for lazy loading
  OE> Warning in file(con, "r") :
  OE>   cannot open file 'vignettes/Read_and_Write_Functions.Rmd.orig': No such file or directory
  OE> Error in file(con, "r") : cannot open the connection
  OE> Error: unable to load R code in package ‘scCustomize’
  OE> Execution halted
  OE> ERROR: lazy loading failed for package ‘scCustomize’
  OE> * removing ‘/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpjsfMWD/pkg-libd1270365e48/scCustomize’

Not sure why that's happening though...

:wave: @samuel_marsh! You have put the .orig files in .Rbuildignore but you have the code to compile them under R/ so R was trying to compile them but they weren't there. That code should be in another folder, and might .Rbuildignore-d.

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.