Learning Objectives

  • Become comfortable with the RStudio Interface
  • Practice recording written explanations and code chunks in an RMarkdown file and kniting the file into a report
  • Import and explore a dataset; work with individual rows and columns
  • Create simple visual and numerical summaries of the data
  • Manipulate a dataset to add new variables

As the labs progress, you are encouraged to explore beyond what the labs dictate; a willingness to experiment will make you a much better programmer. Before we get to that stage, however, you need to build some basic fluency in R. Today we begin with the fundamental building blocks of exploring and summarizing data in R.

Note that the exercises interspersed in this tutorial are just for practice; you do not need to submit anything from this tutorial. However, we will practice writing up our work in an RMarkdown report. Having your code from this tutorial saved in a reproducible report will allow you to refer back to the code and will help you complete Lab 1 and HW2.

As a final note, please read all of the text in the document. Often, students skip quickly through labs and only pay attention to code chunks and exercises. The text in the labs and tutorials highlights important concepts that you are expected to know.

The Basics

Launch RStudio. You should see the familiar window that looks like the image shown below.