From murdoch.duncan at gmail.com  Mon Nov 28 23:34:12 2011
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 28 Nov 2011 17:34:12 -0500
Subject: [Rd] Bug in Sys.which()?
In-Reply-To: <CAF42j21Be80gVe3s3UVqz4cFSC54_kB_Co9TVfrfQBz+NHpEZQ@mail.gmail.com>
References: <CAF42j21Be80gVe3s3UVqz4cFSC54_kB_Co9TVfrfQBz+NHpEZQ@mail.gmail.com>
Message-ID: <4ED40C64.9060406@gmail.com>

On 11-11-28 5:20 PM, Dan Tenenbaum wrote:
> At a Windows command prompt:
> C:\>which ls
> /cygdrive/c/Rtools215/bin/ls
>
> C:\>which perl
> /cygdrive/c/perl/bin/perl
>
> In R:
>> Sys.which(c("ls", "perl"))
>                           ls                        perl
> "c:\\RTOOLS~3\\bin\\ls.exe"                          ""
>
> Is this expected behavior?

R doesn't necessarily have the same search path as your command prompt. 
  (Look at PATH in your command line, and Sys.getenv("PATH") in R, to 
compare.) When I try Sys.which() that with two things known to be on the 
path that R uses, it finds both.

Duncan Murdoch

>
>> sessionInfo()
> R Under development (unstable) (2011-10-28 r57459)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_2.15.0
>
>
> Thanks,
> Dan
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Bug in Sys.which()?
Duncan Murdoch