NCEAS / recordr

Provenance tracking for R.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement user options for location of recordr working directory

gothub opened this issue · comments

The record() function stores prov data and archived files at ~/.recordr. CRAN has removed (archived) the recordr package because writing to the users home dir is a violation of CRAN policies.

@mbjones has proposed explicitly asking the user where they would like recordr to store
data, or possibly using the R session temp directory until they specify a permanent
location. Other examples of handling this problem in R:

Writing to the R session temp directory by default would allow users to easily evaluate the
package with no configuration effort. Then, if they decide to move past the evaluation,
they could either define an R option or enter a recordr command to specify where a permanent location of the recordr data would be written to.

Recordr would inform the user when they first use the package that data is being written to the
session temp directory. When they configure recordr to write to a permanent location they would be reminded when they first write to it. By performing the configuration step, they would be explicitly giving their consent to write to that location.

I think the default temp dir solution is a good one. We could do the same in Matlab, where we use the userpath() command to get the default working directory, which is:

  • Windows platforms — %USERPROFILE%/Documents/MATLAB.
  • Mac platforms — $home/Documents/MATLAB.
  • Linux® platforms — $home/Documents/MATLAB if $home/Documents exists.

@csjx sounds good.

Just to be clear, using the R session temp directory means that all recordr info is deleted
when the user ends their R session. Kind of a drastic solution, but it means that users
can start using recordr (in demo mode) without any configuration.

When the user would change the configuration to use a permanent location they would be given choices similar to:

  • Mac: "/Users/bob/Library/Application Support/recordr"
  • Linux: "/home/bob/.config/recordr"
  • Windows - "C:\Users\bob\AppData\Local\Acme\SuperApp"

These default locations for user 'bob'. The R package 'appdirs' which figures out the
default directory. Alternatively the user could not use the default location and specify another
location.