Skip to content

Instantly share code, notes, and snippets.

@christophergandrud
Created April 18, 2013 01:07
Show Gist options
  • Save christophergandrud/5409072 to your computer and use it in GitHub Desktop.
Save christophergandrud/5409072 to your computer and use it in GitHub Desktop.
the `stataDo` function does not currently work. More of an aspiration than a reality.
############
# stataDo: A function for running Stata do files in batch mode from R
# Christopher Gandrud
# 22 January 2013
############
# Note: Stata must be in your PATH for this to work.
## For Mac Users see: http://www.stata.com/support/faqs/mac/advanced-topics/
stataDo <- function(dofile, options = "-e"){
system(paste("bash ;", "Stata", options, dofile, "; exit", sep = " "))
}
setwd("~/Desktop/")
stataDo(dofile = "AMCCRR.do")
system("Stata -e")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment