This repository contains materials for an introductory R programming course designed for MCom Economics students at Stellenbosch University. The course focuses on essential R programming concepts, data analysis, and statistical methods commonly used in economics research.
coding-in-r/
├── assignment/ # Student assignment materials
├── data/ # Dataset files for exercises
├── memorandum/ # Assignment solutions and explanations
├── scripts/ # Utility R scripts
└── tutorial/ # Main tutorial content and exercises
The main tutorial provides a comprehensive introduction to R programming, covering basic operations, data manipulation, visualization, and statistical analysis techniques commonly used in economics.
The assignment tests practical implementation of core concepts, focusing on data handling, visualization, and regression analysis in an economics context.
The course uses real-world economic datasets, including Irish energy consumption data and cross-sectional wage data, to demonstrate practical applications.
The scripts/
directory contains package management and installation utilities.
To use these materials, you'll need:
- R (version 4.3.2 or later)
- RStudio Desktop
- Required R packages (installable via
pacman::p_load()
)
- Clone this repository
- Open the
coding-in-r.Rproj
file in RStudio - Run the setup scripts in the
scripts/
directory - Follow along with
tutorial/tutorial.Rmd
Should you need additional resources to get started, try the following:
- Quick-R
- Data Science Programming Methods (STAT 447) by Dirk Eddelbuettel (University of Illinois)
- RStudio Cheatsheets
- Data Science for Economists (EC 607) by Grant McDermott (University of Oregon)
- Data to Viz - Excellent data visualization guide with R code
- wihantemplates - R package with useful R Markdown templates for academic writing, including Stellenbosch University dissertation templates
- Sign up for GitHub Pro using your university credentials
- Download GitHub Desktop for version control
These lecture notes are compiled from the following resources:
- R Intro (2018) by Grant R. McDermott and Ed Rubin
- Data Science for Economics and Finance: Getting you staRted (2021) by N.F. Katzke
- Stata2R
This material is provided for educational purposes. Please check with the original authors for usage rights and attribution requirements.