1

I have written a fairly extensive function but I still need to debug it. As I've been running the function several times, the available hard drive space is slowly decreasing from my system drive. Just over the last day or two it's taken up 10-20 GB of space on the hard drive (with nothing to my knowledge being downloaded in the background).

Since I've found this problem I've moved my script into an R project on another drive, but the system drive continues to fill up. The code generates a few tables and graphs, with all the results being stored in a list variable from which I then display the graphs. I clean the environment/plot windows every time I run the function.

I've checked all the R installation folders but they all look roughly the right size/not too big. Is there anywhere else on a default installation that R could be storing files that is causing this issue?

Similar question asked here 3 years ago with no solution (haven't tried reinstalling R or Rstudio yet though).

Windows x64 and R x64 installation.

Flamexio
  • 11
  • 1
  • 2
    Did you check the local R project folder for hidden files or the temporary files folder? When you run R, temporary files/data would be stored in the temporary directory. Here's how to find the temporary folder: https://stackoverflow.com/a/14459468/6288065 – LC-datascientist Aug 26 '21 at 04:55
  • Thanks for your response. I've checked the tempfile() folder that R pointed to and unfortunately it was only 2MB. I've checked the program files installation of both R and Rstudio but they are not unreasonable sizes. Any other places that R might be hiding stuff or am I just out of luck? If I am out of luck, I might uninstall R and Rstudio and move the installation to another drive and hope it stops. I've run the code a few times since I've posted this and lost another 500MB I think. – Flamexio Aug 26 '21 at 05:07
  • 1
    It's really hard to say what could be going on without any details at all. What does this script do? What packages are involved? Unless you can make a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), it's not going to be easy to help. You can try the [RStudio community support forums](https://community.rstudio.com/) or file an [RStudio issue](https://github.com/rstudio/rstudio/issues) – MrFlick Aug 26 '21 at 05:57
  • Fair enough, it's not extremely urgent. I just thought there might be something simple I'm missing. I use the ggplot2, latex2exp (for latex typeset in ggplots) and gridExtra packages. The function does some bootstrap samples as well as general regression and power calculations using a range of methods (so I can compare them) for a range of sample sizes (randomly generating for X amount of times). I store the results of the function in a fairly large list which includes some plots (but I'll eventually change it so that the plots are generated outside the function). – Flamexio Aug 26 '21 at 06:35
  • Did you ever figure it out? I am having the some problem, but it is really starting to get out of hand by now. I had 390 GB on my SSD at the start of last week, now I have 177 GB. – Marlen Jan 17 '23 at 13:48

0 Answers0