R Intro (Winter 2024 / RSM456)

R is an open-source programming language for statistical computing and graphics. R is extensible, and has a large collection of high-quality user contributed packages that provides easy tools for common data analysis tasks. This 4-session workshop will introduce you the basics of R programming and data analysis.


What To Prepare

Please install R and RStudio Desktop before the first session.

If you encounter technical difficulties installing the software, you can instead create a free RStudio Cloud account so you can run R in the cloud via your browser.

An alternative to RStudio Cloud is the UofT JupyterHub/RStudio system. Go to its home page, choose the RStudio option, and click Log in to start. You will need your UTORid to login.


Session 1 Basics

  • Slides
    • Navigate RStudio
    • Install and load R packages
    • Load/import a tabular dataset into a dataframer/tibble
    • R basic syntax (data and programming structures)
  • Data
  • Code
    • Get started (We will code this one together)
    • R basic data structures (R Notebook )
    • R basic programming structures (R Notebook )
  • Reading list

Session 2 Descriptive Statistics, T-test, and Linear Regression

  • Slides
    • Descriptive statistics (mean, median, variance, etc.)
    • T-test (t.test())
    • Linear regression (lm(), read/interpret regression results)
  • Code
    • T-test (R Notebook )
    • Linear Regression - Base R tooling (R Notebook )
    • Linear Regression - Tidyverse & Others (Optional) (R Notebook )

Session 3 K-means Clustering

  • Slides
  • Code
    • K-means (R Notebook )

Session 4 Logistic Regression

  • Slides
  • Code
    • Logistic regression (R Notebook )

Resources


Back to TDMDAL Computing Page