Skip to content
Prev 264134 / 398502 Next

Update MS Windows PATH variable based on a R script

On 29/06/2011 2:24 PM, Janko Thyson wrote:
You need to set the registry entry if you want a persistent change to 
the PATH.  Sys.setenv just modifies R's copy of the PATH.  Child 
processes will see the modifications, but they don't last beyond the R 
session.

You'll have to check MS docs to find which registry entry to mess with. 
  Alternatively, if you feel lucky, just use Control Panel to set some 
strange path, then see where your change showed up using regedit.

R doesn't have a built-in function to write to the registry, but there 
are various utilities available outside of R to do it.

Duncan Murdoch