Intro to R

Get Ready!

  • Before the first session, make sure you have installed or updated R, RStudio, and the tidyverse package. Instructions are here.
  • Download the data files and R scripts:
    • Download this zipped folder. It contains one data file (albemarle_homes_2020.csv) and two R scripts (intro_R.R, intro_R_answers.R).
    • Unzip it and put it somewhere you can locate it on your machine.

Goals for our Workshop

These are the goals for today’s workshop:

  • Understand the features of R
  • Know where to look for help and to learn more about R
  • Orient yourself to R and RStudio
  • Understand the basics of working with data: load, explore, and save data
  • Learn some best practices for using R scripts, using data, and projects
  • Understand the basics of objects, functions, and indexing

The intended audience is beginner-level, with no previous experience using R.

We will focus on using R for data analysis throughout this series.

Features of R

  • R is free!
  • R is everywhere, and has an active user base. This is useful because you can find a lot of people in various disciplines using R in blogs, forums, Stack Overflow, etc., and you can often find help online there.
  • R is flexible! Since R is open source, the active R user base quickly implements new methods as libraries in R. Over 10,000 packages are available.
  • R is cool! It is highly regarded for its:
    • Graphical functionality. See gplot2, ggplot extensions.
    • Interactive web functionality. See shiny.
    • Reproducible output, such as documents, presentations, and dashboards. See R Markdown.
    • Easy integration with other open-source or data science applications, such as Sublime Text, Jupyter Notebooks, GitHub, etc.

Orientation to R and RStudio

R is the underlying statistical computing environment. You can think of this like the engine of a car. That makes RStudio like the dashboard1.