folder locations for projects... secondary use

here
rstudioapi

#1

Rstudio IDE clearly holds the current absolute path for several recent projects, (or at least where the project was last located). Is that project/path table accessible for use?

Background:

I have one project which assembles datasets, and several other projects which analyze these data. Thus, I often find a need to refer to datasets which live in other projects, and I resort to bad habits - absolute references, etc.

I am imagining a "there" package - akin to the "here" package - which would help find files within other projects. It would do this by identifying a file by its associated project and internally-referenced path, rather than the absolute path.

More specifically, if here::here() produced something like

/home/me/project1

then

there::there("project2") would produce something like

/home/me/project2

and I could refer to files within that other project with the same parsimony and clarity as is provided by here::here, e.g. there::there("project2", "data/derived/diamonds.fst")

Comments? Suggestions?

To make this work would require accessing the file which Rstudio IDE uses to adjust paths when projects are changed,selected.


#2

Two-part answer:

  1. On my machine (Windows), I found a plain-text list of recent projects at

    C:/Users/[me]/AppData/Local/RStudio-Desktop/monitored/lists/project_mru
    
  2. I'd suggest using a common data location and having each project "publish" data there. Even just a folder named shared-data somewhere any project can reach. This reinforces a clear line between "project only" and "public" assets. Otherwise, changes in one project can cause unforeseen breakages in others.

    If you want to be more ambitious, use a database. I learned database stuff with SQLite, which was nice because "setting one up" is as easy as creating a file with the RSQLite package.


#3

Thanks nwerth!

Still want to do some thinking on this. Symbolic links might be the way to go. But, a problem in need of a solution or three.

Thank you again.
R