1

I have a function that takes a while to run in one of my packages. It only gets called when building vignettes, so to save on build time I stored the output to the package's internal data with usethis::use_data(). The file saved to R/sysdata.rda and is about 10Mb, so now I get a warning when checking:

sub-directories of 1Mb or more: R 9.7Mb

Would adding `^R/sysdata.rda$ to my .Rbuildignore alleviate this? Or is there a better alternative?

Mark Rieke
  • 306
  • 3
  • 13
  • 1
    Putting it in Rbuildignore will mean the file is not available for vignette building when the package is built from source, so it will fail the checks. It is possible to have a package larger than 10MB if you have a good reason to give to CRAN, but if your data is only used for a vignette, you would probably be better to get a different example dataset or fudge the example in the vignette. – Allan Cameron Mar 13 '22 at 19:40
  • 1
    It's not clear from your question if the vignette could be built without that file being present. Are you essentially caching it, and things would work (but slowly) without it? If so, not including it in the tarball makes sense (but it shouldn't have been stored in sysdata.rda, store it somewhere that R never uses). On the other hand, if the file is necessary to build the vignette, then do as @AllanCameron says: choose a smaller example. – user2554330 Mar 13 '22 at 20:35
  • After some poking around, I ended up putting together a data-only package that hosts the files on github. Since it was only needed for the vignette, I was able to read in the .rds file from github rather than re-creating it in the vignette everytime I ran `devtools::check()` – Mark Rieke Mar 13 '22 at 21:46

1 Answers1

0

Put together a data-only package that hosts the files on github. Since it is only needed for the vignette, read in the .rds file from github rather than re-creating it in the vignette everytime devtools::check() is run

user438383
  • 5,716
  • 8
  • 28
  • 43
Dubukay
  • 1,764
  • 1
  • 8
  • 13
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/31306977) – patL Mar 17 '22 at 10:17
  • @patL Thanks for the feedback! Here, I'm attempting to turn the answer provided in a comment into a full answer so that others can see that it's been responded to. I paraphrased the comment from the original poster that describes how they reached a solution in hopes that others might find the question and the same process help them. This seems to be the consensus but I'll admit that the frame-challenge sort of answer in this case seems to be on the edge of acceptable. Relevant Meta: https://meta.stackexchange.com/questions/130370/how-to-avoid-unanswered-questions-with-answers-in-comments – Dubukay Mar 17 '22 at 16:36