Goal: Create your first data analysis report in R!

  1. Download and install R and RStudio, available for Windows/Mac/Linux. If you have trouble installing the software, or have Chrome OS, you can use a web-based version at RStudio Cloud by opening a free account.

  2. Create a new folder and associated R project called “WS1”. Verify your working directory by running getwd()

# You R code goes here
# (comments start with the pound key "#"" 
# and are not executed)
  1. Install the babynames package on your computer. Either run install.packages("babynames") once in the console, or go to the Tools > Install Packages… tab.

  2. Load the package by running library(babynames). This will make the babynames data available for your R session. Look at the first few lines of data using head(babynames).

  3. The file babynames15.csv contains the data for 2015 alone. Copy this file in a new subfolder of your working directory named data. Read the file into an R object using babynames15 = read.csv("data/babynames15.csv").

  4. Print the first few rows of the data using head(babynames15).

  5. Create a barplot with the proportion of the most popular female names using: barplot( height = head(babynames15)$prop, names.arg = head(babynames15)$name ).

  6. Complete the following mathematical equation \[ \sum _{n=0}^{\infty} \frac{1}{2^n} = ? \]

Fill in your name and ID # in the preamble. Then “knit” the Rmarkdown document into an html file and submit on Quercus.

Congratulations, you have created your first Rmarkdown report!

LS0tDQp0aXRsZTogIlNUQUE1NyAtIFdvcmtTaGVldCAxIg0KYXV0aG9yOiAnTmFtZTogICAsIElEIzogICAnDQpvdXRwdXQ6DQogIGh0bWxfbm90ZWJvb2sNCmVkaXRvcl9vcHRpb25zOiANCiAgY2h1bmtfb3V0cHV0X3R5cGU6IGlubGluZQ0KLS0tDQoNCg0KKkdvYWwqOiBDcmVhdGUgeW91ciBmaXJzdCBkYXRhIGFuYWx5c2lzIHJlcG9ydCBpbiBSIQ0KDQowLiBEb3dubG9hZCBhbmQgaW5zdGFsbCBbUl0oaHR0cHM6Ly9jcmFuLnItcHJvamVjdC5vcmcvKSBhbmQgW1JTdHVkaW9dKGh0dHBzOi8vd3d3LnJzdHVkaW8uY29tLyksIGF2YWlsYWJsZSBmb3IgV2luZG93cy9NYWMvTGludXguIElmIHlvdSBoYXZlIHRyb3VibGUgaW5zdGFsbGluZyB0aGUgc29mdHdhcmUsIG9yIGhhdmUgQ2hyb21lI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