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

From |
Michael Hanson <mshanson@mac.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: Invoking R from Stata |

Date |
Mon, 01 Dec 2008 19:45:50 -0500 |

While I'm on the topic of platform independence....

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"; }; };

Hope this helps, Mike

On Dec 1, 2008, at 6:08 PM, Kit Baum wrote:He is referring to Roger Newson's -rsource- package on SSC. I just tried it under Mac OS X 10.5 and it works fine. In Stata, do global Rterm_path "/usr/bin/r" global Rterm_options `"--vanilla"' Then if we have a file test.R containing ----- 2+2 q() ----- . rsource using test.R Assumed R program path: "/usr/bin/r" Beginning of R output from source file: test.R R version 2.6.2 (2008-02-08) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > 2+2 [1] 4 > q() End of R output from source file: test.RNo doubt by changing the Rterm_options you can alter the way inwhich it produces output. Note that under *nix there is noseparate executable Rterm; it is just the binary executable r.When you install R on Mac OS X, you get R.app, which is theexecutable that provides the GUI, but under the hood it calls /usr/bin/r.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

On Dec 1, 2008, at 5:29 PM, David Airey wrote:

Has anyone used _rsource_ with the Apple OS X operating system? -Dave On Dec 1, 2008, at 1:00 PM, Martin Weiss wrote:Line for the server...That is exactly what -rsource- does, but it also takes care oflogging...HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of OrvalhoAugustoSent: Monday, December 01, 2008 7:56 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: RE: Invoking R from Stata Run from stata: ! /path/to/R.exe /path/to/rscriptfile ! means to invoke a shel command. Caveman On 12/1/08, Martin Weiss <martin.weiss1@gmx.de> wrote:Line for the server... *********** ssc d rsource *********** HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Ljubica Nedelkoska Sent: Monday, December 01, 2008 4:38 PM To: statalist@hsphsun2.harvard.edu Subject: st: Invoking R from Stata Dear Statlist members,I would like to run a file written in R program from a Stata dofile. Iwould appreciate if somebody helps me how to invoke R from Stata. Many thanks! Ljubica Ljubica Nedelkoska PhD student Research group: "Economics of Innovative Change" Friedrich Schiller Universität-Jena +49(0)3641 (9) 43 272

* * 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/

**Follow-Ups**:**Re: st: RE: Invoking R from Stata***From:*David Airey <david.airey@vanderbilt.edu>

**References**:**st: Invoking R from Stata***From:*Ljubica Nedelkoska <Ljubica.Nedelkoska@uni-jena.de>

**Re: st: RE: Invoking R from Stata***From:*"Orvalho Augusto" <orvaquim@gmail.com>

**Re: st: RE: Invoking R from Stata***From:*David Airey <david.airey@Vanderbilt.Edu>

- Prev by Date:
**Re: st: Re: grc1leg** - Next by Date:
**Re: st: RE: Invoking R from Stata** - Previous by thread:
**Re: st: RE: Invoking R from Stata** - Next by thread:
**Re: st: RE: Invoking R from Stata** - Index(es):

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