Programming in R

Why Use R?

  • Designed specifically for statistical computing and data analysis.
  • Includes a vast library of packages for advanced data visualization.
  • Features powerful visualization tools like "ggplot2," renowned for its versatility and aesthetic quality.
  • Accessible and user-friendly, making it ideal for non-programmers.

Important R Packages

A package in R is a collection of functions, datasets, and documentation bundled together to extend the functionality of the base R programming language. These packages simplify tasks like data manipulation, visualization, and statistical modeling; the ones listed below are especially useful for economic research.

  • ggplot2: A powerful and versatile package for creating aesthetically pleasing and customizable data visualizations.
  • dplyr: Provides a suite of functions for data manipulation, such as filtering, sorting, and summarizing datasets, with a focus on readability and efficiency.
  • tidyr: Simplifies reshaping and tidying messy data, making it easier to work with complex datasets.

Introductory R Courses at Duke

  • STA 199: Introduction to Data Science and Statistical Thinking
    • An introductory data science course designed for beginners
    • Students learn to explore, analyze, and visualize data in R
    • Gain experience in data wrangling, predictive modeling, and effective communication of results
  • STA 198: Introduction to Global Health Data Science
    • Introduction to health data science using current applications in biomedical research, epidemiology, and health policy.
    • Use R to conduct reproducible data exploration, visualization, and analysis. 
    • Interpret and translate results for interdisciplinary researchers.

Asynchronous R Courses

  • Data Analysis with R Specialization (Coursera)
    • An introductory R course taught be Duke's STA 199 Professor, Mine Çetinkaya-Rundel
    • Basic data visualization, statistical testing and inference, and linear modeling
  • DataCamp R Course
    • Learn the R basics including vectors, factors, lists, and data frames.
    • The DataCamp site offers R certifications

R Resources