[Rd] Fwd: Using existing envars in Renviron on friendly Windows

Michał Bojanowski m|ch@|2992 @end|ng |rom gm@||@com
Fri Oct 15 16:44:28 CEST 2021

Dear colleagues,

I would be grateful if somebody could explain and perhaps help work
around the following.

I have .Renviron with, say:


Which is a documented way of referring to existing environment
variables. Now, with that in R I'm getting:

Sys.getenv("APPDATA")    # That works OK
[1] "C:\\Users\\mbojanowski\\AppData\\Roaming"

so OK, but:

[1] "C:UsersmbojanowskiAppDataRoaming/foo/bar"

So all the (back)slashes are gone from APPDATA.

Does processing ${} removes the backslashes? I could not find anything
on that in R Windows FAQ nor on the web.
Thanks in advance!


More information about the R-devel mailing list