Re: [Rd] How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?

2015-05-19 Thread Roebuck,Paul L
This is the code I use in my 'SuperCurve' R-Forge package: ##- ## Merge output graphs with source tiff file, save it as JPG file .mergeGraphsAndImage <- function(antibody, prefix,

Re: [Rd] How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?

2015-05-19 Thread Josh O'Brien
On Mon, May 18, 2015 at 10:29 AM, Josh O'Brien wrote: > My question: > > On Windows, R's system() command prepends several directories to those > in the Windows Path variable. > > From ?system > > The search path for 'command' may be system-dependent: it will > include the R 'bin' direct

Re: [Rd] How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?

2015-05-18 Thread Henrik Bengtsson
You probably already know, but you can at least work around it as: Sys.which2 <- function(cmd) { stopifnot(length(cmd) == 1) if (.Platform$OS.type == "windows") { suppressWarnings({ pathname <- shell(sprintf("where %s 2> NUL", cmd), intern=TRUE)[1] }) if (!is.na(pathname)) retu

Re: [Rd] How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?

2015-05-18 Thread Yihui Xie
+1 I have exactly the same problem. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Mon, May 18, 2015 at 12:29 PM, Josh O'Brien wrote: > My question: > > On Windows, R's system() command prepends several directories to those > in the Windows Path variable. > > >From ?system > > The

[Rd] How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?

2015-05-18 Thread Josh O'Brien
My question: On Windows, R's system() command prepends several directories to those in the Windows Path variable. >From ?system The search path for 'command' may be system-dependent: it will include the R 'bin' directory, the working directory and the Windows system directories be