Re: [Rd] Evaluate values in `Sys.setenv`

2020-08-28 Thread peter dalgaard
It is the shell that does the ~ and $ expansions, and Sys.setenv() doesn't go via the shell, so you cannot expect it to understand the shell metacharacters. Instead, you need to do the corresponding computations in R, e.g. > paste(path.expand("~/mypath"), Sys.getenv("PATH"), sep=":") [1] "/Use

[Rd] Evaluate values in `Sys.setenv`

2020-08-28 Thread Jeff King
Hi all, I would like to know if there is any way to evaluate the values in `Sys.setenv` before setting the environment variables. For example, if we want to add a path to the environment variable `PATH`, we can do this in a terminal ``` > export PATH=~/mypath:$PATH > echo $PATH /Users/jeff/mypath