Best practices for using tools::R_user_dir()

The tools::R_user_dir() seems an intriguing new feature of R 4.0, with possibility of persistent client side caching. This has fun implications for all sorts of package development tasks (I am most interested in caching spatial objects downloaded over the internet - these tend to be rather big and rather slow to change, so good candidates for caching, but that is just me - there will be other good use cases).

A problem I have encountered though is that the caching directory can not be created on automated testing platforms (think Travis and winbuilder). Not only the cache directory for the package in question does not exist (I can live with that / create my own) but its parent directory does not either. I am not quite so comfortable creating the parent (a directory for all R package caches).

Is there a "best practice" / consensus approach for this?

1 Like

This topic was automatically closed after 45 days. 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.