2

Over time, I have a lot of older targets in my drake cache (current==FALSE under drake_history()). I've renamed many of my targets over time, so I'm left with targets in drake_history() which are current==TRUE, however they're not in my current drake plan.

Is there a way to clean up the cache to get rid of all older targets (to save space), and also remove any targets (current or otherwise) which are not in my plan?

Rahul

Rahul
  • 2,579
  • 1
  • 13
  • 22

1 Answers1

6

Yes, drake's cache has garbage collection. To remove old targets and save space, you can call drake_gc() or drake_cache()$gc().

landau
  • 5,636
  • 1
  • 22
  • 50
  • Thank you @landau. On a different note, is there a way to change the font size in `drake::r_sankey_drake_graph()`? – Rahul Oct 25 '19 at 04:42
  • Not yet, but it looks possible. – landau Oct 25 '19 at 11:01
  • 1
    I forgot: you can pass fontSize and fontFamily to `sankey_drake_graph()` etc. They are not formal arguments, but you can pass them as informal arguments through `...`. – landau Oct 25 '19 at 12:24
  • I tried this today, but it doesn't seem to get rid of targets currently not in the plan. I still see older ones in the plan upon running `drake_gc()`. – Rahul Oct 28 '19 at 18:58
  • The objects returned by `drake_history() %>% filter(current==FALSE)`.. are these also in the cache? Is there a way to get rid of them to reduce the cache size? – Rahul Oct 28 '19 at 19:02
  • Those files are in `.drake/drake/history/`. You can prevent `drake` from writing them using `make(history = FALSE)`. – landau Oct 28 '19 at 19:05