How can I store data that needs to be accessed from multiple R Projects whilst retaining code portability?
From within a project that I'm working on in R, I can access data stored approximately anywhere on my system. But if it is at an arbitrary location outside of the project then that hampers code portability.
I have projects that I want to be able to work on on two different machines, with different directory setups. For data that can be stored within the project, this can work fine as I can use tools like setting the project up as an RStudio Project and using the here package to refer to the data's location.
However, I have some data that (a) I want to use in multiple projects and (b) is pretty large. Consequently, I don't want to duplicate it to all of the projects I might use it in.
I can kind of work around this for projects where only I am working on them, by setting up a consistent folder structure at least relative to the projects and using relative paths. E.g., I can resolve to store these multi-project datasets in a Data folder that's two levels up from where the project lives.
shared_data_location <- "../../Data/"
But where I'm working on project with collaborators, even that is a bit of an imposition / assumption about where they will be able to put their code folders and data folders.