1

I am writing a package in R. I have run devtools::check() with no problems. I have then run the package goodpractice() and it tells me the following error

Preparing: covr
Preparing: cyclocomp
Error: 
Build failed, standard output:

* checking for file ‘EndoMineR/DESCRIPTION’ ... OK
 ERROR
copying to build directory failed

Standard error:

cp: error writing '/tmp/Rtmpy74ibO/Rbuild1ae3169e0658/EndoMineR/.git/objects/74/8f2d9ae99fac31a977033245508f76a97742ba': No space left on device

I checked out the file sizes in my project and there are a lot of git objects and RData files that seem quite big. How can I prevent/ clear them?

I have tried rm(list = ls()) but alas nothing is cleared. Restarting the R session also doesn't help neither does restarting the computer....

The top 18 files by size are:

names                                                            size
.Rproj.user/7D2C911B/viewer-cache/5505A8A5.Rdata                6466374
.Rproj.user/7D2C911B/viewer-cache/CF1A8B27.Rdata                6079304
.Rproj.user/7D2C911B/viewer-cache/A473A4E7.Rdata                5915817
.Rproj.user/7D2C911B/viewer-cache/9BA3E3A.Rdata                 2688673
.Rproj.user/7D2C911B/viewer-cache/3CEDE309.Rdata                2688652
 docs/reference/ColumnCleanUpAll.html                           2538509
 vignettes/EndoMineR.html                                       1569061
.Rproj.user/7D2C911B/viewer-cache/D758DB8B.Rdata                1535171
 vignettes/Analysis.html                                        1506119
.git/objects/ef/c2beec915e2b8f071b8e03661e1581f1b28861          1402135
 docs/reference/ColumnCleanUp.html                              1356180
 vignettes/Barretts.html                                        1284018
.git/objects/45/f3d91cc5a108bf6824e592256de33feeb41353          1156350
.git/objects/05/d099d8dd99706703fd61d0b0aed554954c98ef          1083595
.git/objects/0e/868ea5db55f58d3456e08ede2e7f6c686e5ed6          1070620
.git/objects/72/857916c6f2190e59043690cf5ba26e06fa9e75          1052846
.git/objects/08/fcfde691f59b4ddce1cefa17d7b9c525a3ae4a          1052841
.git/objects/0f/56aa3906327b8653b2c1c1e7107cafbfa2888d          1052831
Sebastian Zeki
  • 6,690
  • 11
  • 60
  • 125
  • 2
    One thing you could try is ignoring .Rdata files. In your .gitignore file put *.Rdata – jrlewi Feb 28 '18 at 13:06
  • @jrlewi. That doesn't work unfortunately. Tried it, rebuilt the package. When I restart the session I still have the same files in the viewer-cache. Should I/ How can I empty this cache. What is is for and where is it from ?knitr? – Sebastian Zeki Feb 28 '18 at 13:16
  • 1
    hmm - do you have rmd files building a vignette or something else with cached code chunks? This would create cached files so that everytime the rmd file is called it doesn't have to re-run things that take a long time. Also, What might be happing is that git has saved the entire history of all the .Rdata files. Since this is a binary file, each save is the full fill (not just a diff-ed) version. Even with compression, this has the potential to grow large (https://stackoverflow.com/questions/5771492/git-vs-svn-with-non-text-files-large-projects#5771766). – jrlewi Feb 28 '18 at 13:26
  • You might just have to delete these files from your repo, but keep them locally. – jrlewi Feb 28 '18 at 13:28
  • Hi @jrlewi Sounds like there are two problems 1) Removing Rproj Viewer-cache files (even though there are no open Views) and 2) removal of cached git objects from my knitr vignettes. My question is then a) To remove the git objects I assume I just use open the shell locally and use git rm and b) How do I remove the viewer-cache files and c) How do I prevent caching from the vignettes? – Sebastian Zeki Feb 28 '18 at 13:51
  • a) looks like that is what you need https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery. b) same method as a)?. c)I think this depends on what you're using to build your vignettes. For rmarkdown, there is a code chunk option cache = TRUE/FALSE. If the chunk runs quickly, make sure these are set to false. – jrlewi Feb 28 '18 at 14:14
  • 1
    @jrlewi OK I sorted it by using git gc and then removing dangling objects that I found with git fsck --dangling and then removing them with – Sebastian Zeki Feb 28 '18 at 14:54

0 Answers0