Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: st: re: invoking R from Stata


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   re: st: re: invoking R from Stata
Date   Mon, 1 Dec 2008 20:42:30 -0500

< >
Michael said

I noticed from -help rsource- that the "Rterm_path" global macro of
Roger Newson's -rsource- procedure defaults to a value of
"Rterm.exe".  In light of Kit Baum's response to David Airey (quoted
below), it seems that a more robust solution would be to replace
lines 30-32 of rsource.ado:

   if `"`rpath'"'=="" {;
     local rpath "Rterm.exe";
   };

with the following:

   if `"`rpath'"'=="" {;
     if c(os) == "Windows" {;
       local rpath "Rterm.exe";
     };
     else {;
       local rpath "/usr/bin/r";
     };
   };

If I understand Kit's message correctly, the latter executable path
is valid for any Unix-based installation of R (including R.app on Mac
OS X).



I do have a symlink (ln -s) from a file within the R.app package to / usr/bin/r. I don't recall having made that link myself, and it is dated the same date as the directory R.app (yes, OS X .apps are really directories---as is Stata.app), so I imagine the R installer probably created the symlink (with my permission, as it is owned by root). It would be sensible for Roger N. to do something like

local rpath = cond(c(os) == "Windows", "Rterm.exe", "/usr/bin/r")

to make his routine platform-independent.

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index