R/Rstudio slowly taking up hard drive storage

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.

Hi @Flamexio,
Might be worth checking to see if R's temporary file directory is being used by your function and collecting unwanted files.

list.files(tempdir(), all.files=TRUE, recursive=TRUE)

This topic was automatically closed 21 days after the last reply. 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.