Short example of using makefiles with R and Stata
get_data.do
: Downloads sample data from ats.ucla.edu and saves it to a.dta
file.model.do
: Runs basic regression models on the datafigures.R
: Usesggplot2
in R to create a few figuresMakefile.example
: Fully working Makefile that links all these files together. We'll create this together.
Make sure you do the following things before we do this together:
- Download R and install it.
- Download RStudio and install it.
- Register as an Apple Developer.
- Download the "Command Line Tools (OS X xxxx) for Xcode", with Lion, Mountain Lion, or Mavericks in place of xxxx. Install it.
- Install the Stata terminal utility (Stata > Install Terminal Utility…)
- Download R and install it.
- Download RStudio and install it.
- Download Make for Windows and install it.