Re: [R] How do I know where is R? - VB Programming

2009-07-15 Thread Peter Dalgaard

Duncan Murdoch wrote:

On 14/07/2009 7:22 PM, Haoda Fu wrote:

Dear all -

Is there anyone know how to let VB or C# know where I install R 
automatically(i.e. auto detect R directory)?


On Windows if you run the installer it will record its location in the 
registry, under *\Software\R-core\R\, where * is HKLM or HKCU, depending 
on what permissions the user had who installed it.  But some users don't 
run the installer (maybe because someone else installed it on a network, 
or they built it themselves) so that isn't completely reliable.


On Unix/Linux we have

$ R RHOME
/usr/lib/R

but same thing doesn't work with Rterm on Windows AFAICS. I wonder if it 
shouldn't?



--
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - (p.dalga...@biostat.ku.dk)  FAX: (+45) 35327907

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I know where is R? - VB Programming

2009-07-15 Thread Gabor Grothendieck
This works on Linux (at least under bash shell) and also on Windows
Vista and presumably earlier versions of Windows as well:

R --vanilla --slave -e R.home()

but the R part at the beginning does have the problem that it
only works if R is on your path.

If, on Windows, you normally double click the R icon on your
desktop or use the R utilities in the batchfiles distribution
there would be no need to have R on your path.  The batchfiles
utilities use the registry, and failing that heuristics, to locate R.

On Wed, Jul 15, 2009 at 2:13 AM, Peter Dalgaardp.dalga...@biostat.ku.dk wrote:
 Duncan Murdoch wrote:

 On 14/07/2009 7:22 PM, Haoda Fu wrote:

 Dear all -

 Is there anyone know how to let VB or C# know where I install R
 automatically(i.e. auto detect R directory)?

 On Windows if you run the installer it will record its location in the
 registry, under *\Software\R-core\R\, where * is HKLM or HKCU, depending on
 what permissions the user had who installed it.  But some users don't run
 the installer (maybe because someone else installed it on a network, or they
 built it themselves) so that isn't completely reliable.

 On Unix/Linux we have

 $ R RHOME
 /usr/lib/R

 but same thing doesn't work with Rterm on Windows AFAICS. I wonder if it
 shouldn't?


 --
   O__   Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
 ~~ - (p.dalga...@biostat.ku.dk)              FAX: (+45) 35327907

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How do I know where is R? - VB Programming

2009-07-14 Thread Haoda Fu

Dear all -

Is there anyone know how to let VB or C# know where I install R 
automatically(i.e. auto detect R directory)?


Many thanks!

Best,
Haoda

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I know where is R? - VB Programming

2009-07-14 Thread Duncan Murdoch

On 14/07/2009 7:22 PM, Haoda Fu wrote:

Dear all -

Is there anyone know how to let VB or C# know where I install R 
automatically(i.e. auto detect R directory)?


On Windows if you run the installer it will record its location in the 
registry, under *\Software\R-core\R\, where * is HKLM or HKCU, depending 
on what permissions the user had who installed it.  But some users don't 
run the installer (maybe because someone else installed it on a network, 
or they built it themselves) so that isn't completely reliable.


Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I know where is R? - VB Programming

2009-07-14 Thread Gabor Grothendieck
For some examples of using the R registry entries see
Rcmd.bat, Rversions.bat and Rversions.hta in the
batchfiles distribution whose home page is:
http://batchfiles.googlecode.com

On Tue, Jul 14, 2009 at 7:22 PM, Haoda Fufu...@yahoo.com.cn wrote:

 Dear all -

 Is there anyone know how to let VB or C# know where I install R
 automatically(i.e. auto detect R directory)?


 Many thanks!

 Best,
 Haoda

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.