I am working on a package where much of the functionality involves interacting with an sqlite database. For testing I have a small version of the database that is contained directly within the package. But when creating the vignettes I have used the full sqlite database so that I can fully illustrate how functions work etc. From Hadley’s R Packages book in the vignettes chapter:
Note that since you build vignettes locally, CRAN only receives the html/pdf and the source code. However, CRAN does not re-build the vignette. It only checks that the code is runnable (by running it). This means that any packages used by the vignette must be declared in the DESCRIPTION. But this also means that you can use Rmarkdown (which uses pandoc) even though CRAN doesn’t have pandoc installed.
Does this mean that for my vignette to be accepted by CRAN it would need access to the full sqlite database or does “runnable” by chance mean that the code is somehow clean (doubtful). If the vignette does needs completely buildable (which in this case requires the full sqlite database) to be accepted by CRAN what are some strategies for this type of thing here? I can think of two possibilities:
- Run the vignette off the small internal sqlite database but have code that sets that chunk to
echo=FALSE, eval=TRUEthen have another chunk that the user actually sees where
echo=TRUE, eval=FALSEso that the user see the code that accesses the full database (that they would have downloaded locally)?
- Wrapped all the function calls in the vignette in something like if(file.exist(sqlite database) then run the function…
Any there any other strategies here or am I misunderstanding how CRAN accepts vignettes?
Thanks in advance,