Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: Rsource fails after first line

From   "Roger B. Newson" <>
Subject   Re: st: Rsource fails after first line
Date   Thu, 10 Nov 2011 12:25:38 +0000

As far as I can see, it is R that seems to be terminating, not Stata. What does your file "get_data.R" look like in full?

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 09/11/2011 23:24, Richard Herron wrote:
I am using -rsource- from SSC by Roger Newsom, but it fails after the
first line of actual R code (i.e., the comments source, but it returns
to Stata after the first R command).

Here is the relevant code:

global working_dir C:\users\richard\documents\research\term_paper_econ824
global Rterm_path `"C:\Program Files\R\R-2.13.1\bin\x64\Rterm.exe"'
rsource using `"$working_dir\get_data.R"'

And the output, which doesn't provide an error, just returns to Stata:

. rsource using `"$working_dir\get_data.R"'
Assumed R program path: "C:\Program Files\R\R-2.13.1\bin\x64\Rterm.exe"

Beginning of R output from source file:

R version 2.13.1 (2011-07-08)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-mingw32/x64 (64-bit)

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.

# get ETF data from yahoo finance

# housekeeping

End of R output from source file:

I am using Stata 11.2 and R 2.13-1 on a Windows 7 laptop. Any ideas? Thanks!
*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index