The instructions / README.md should more verbosely explain how the .Renviron.d directory is processed, what types of files should be put in there:
which filename extensions they should have,
what kind of syntax is allowed
I think R expects the .Renviron file to have the syntax of a shell script, i.e environment variables can be assigned with or without quotes.
Assignments like
GITHUB_PAT="5b01b1..."
or
GITHUB_PAT=5b01b1...
both are valid for .Renviron files
So if I create a file, say .Renviron.d/S10_mycreds.R, it would be processed by the startup package. But although it can have invalid R syntax (e.g. it has R assignment statements without quotes on the right hand side), it would still be processed silently. But when I open it in Rstudio, the file has warning labels all over the place. This is confusing.
The documentation should explicitly say:
A suitable filename extension for files in the .Renviron.d directory is "...".
.R ? only if all RHS are quoted
.sh ?
.env ?
And what about a naming convention? Should the files have alphanumerical order, like, the files in linux /etc/rc3.d/ directory, for instance?
Also, the README.md does not say that the original file is getting saved as, say, .Rprofile.bak.20170604-102559. Only the startup::install() function gives that information. README.md should say so as well, that a backup will be made .
The backup file could be named .Rprofile.bak.20170604-102559.bak instead, and .bak could be added to the list of filename extensions that get ignored.
Personally, I don't expect ".txt" to be ignored, whereas I'd much more expect ".bak" files to be ignored. But it is easily overlooked that the bak is in the middle of the filename.
The instructions / README.md should more verbosely explain how the .Renviron.d directory is processed, what types of files should be put in there:
I think R expects the .Renviron file to have the syntax of a shell script, i.e environment variables can be assigned with or without quotes.
Assignments like
GITHUB_PAT="5b01b1..." or GITHUB_PAT=5b01b1...
both are valid for .Renviron files
So if I create a file, say .Renviron.d/S10_mycreds.R, it would be processed by the
startup
package. But although it can have invalid R syntax (e.g. it has R assignment statements without quotes on the right hand side), it would still be processed silently. But when I open it in Rstudio, the file has warning labels all over the place. This is confusing.The documentation should explicitly say: A suitable filename extension for files in the .Renviron.d directory is "...".
And what about a naming convention? Should the files have alphanumerical order, like, the files in linux
/etc/rc3.d/
directory, for instance?Also, the README.md does not say that the original file is getting saved as, say,
.Rprofile.bak.20170604-102559
. Only the startup::install() function gives that information. README.md should say so as well, that a backup will be made .The backup file could be named
.Rprofile.bak.20170604-102559.bak
instead, and .bak could be added to the list of filename extensions that get ignored.Personally, I don't expect ".txt" to be ignored, whereas I'd much more expect ".bak" files to be ignored. But it is easily overlooked that the bak is in the middle of the filename.