Introduction to R

Hui Hu Ph.D.

Department of Epidemiology

College of Public Health and Health Professions & College of Medicine

January 18, 2021

R Crash Course

R Markdown and Notebook

R Crash Course

What is R?

  • An object-oriented programming language focused on manipulating and analyzing data
    -  everything in R is an object: e.g. datasets, functions, models, etc.
  • An open-source language
    -  anyone can contribute to the R project, and develop and distribute code to run in R
  • One of the most popular languages used by statisticians and data sicentists
git pull

R Markdown and Notebook

R Markdown

  • R Markdown provides an authoring framework for data science.

  • You can use a single R Markdown file to both

    save and execute code, and generate high quality reports that can be shared with an audience.

R Notebook

  • An R Notebook is an R Markdown document with chunks that can be executed independently and interactively, with output visible immediately beneath the input.

Create a Notebook

  • File->New File-> R Notebook
  • By default, RStudio enables inline output (Notebook mode) on all R Markdown documents, so you can interact with any R Markdown document as though it were a notebook.


By Hui Hu


Slides for Lecture 2, Spring 2021, PHC7065 Critical Skills in Data Manipulation for Population Science

  • 434