Data Into Insights (Spring 2021)/R Lab 1

From CommunityData
Revision as of 01:35, 5 February 2021 by Jdfoote (talk | contribs) (Created page with "This first lab is really just about getting R set up so that you are ready to get going. By the end of this lab you should: # Have your R environment is set up correctly # Un...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This first lab is really just about getting R set up so that you are ready to get going.

By the end of this lab you should:

  1. Have your R environment is set up correctly
  2. Understand the concept of R Markdown files and be able to open and "knit" them
  3. Create your first visualization in R

Installing R and RStudio

R is a statistical programming language, designed to help people work, understand, and visualize data.

We will also be installing RStudio, which is an IDE which makes it much easier to work with R.

So, your first task is to install both R and RStudio as explained in this tutorial.

Once you succeed, you should have an icon for Rstudio, and when you open it, you should see something like this:

RStudio image from Wikipedia

If you can't figure it out, then reach out on #homework-help on Discord, and we can help you.


R Markdown

R Markdown is an approach for making reproducible documents and reports which directly incorporate code.

You can write code and content interspersed. This YouTube video is a nice introduction to how to use and navigate an R Markdown document.

To help you to understand R and R Markdown, I created an example document.

  • Right-click this link and save it to your computer
  • Open it in RStudio
  • "Knit" it and make sure that it works (there should be a "knit" icon near the top of RStudio)
    • If you have problems, make sure that you have installed the tidyverse (as explained in the reading).
  • Complete the exercise at the bottom of the document and knit it again