This lesson assumes you have current versions of the following software installed on your computer:
Both programmes and all R packages are free. RStudio runs the R software within it, so first download R package and install it on your computer. Then download and install RStudio. For detailed instructions for Macs or PCs, see https://datacarpentry.org/r-socialsci/setup.html
If you have never used R or RStudio before, I recommend going through this tutorial, it takes about 30 minutes. At the end of it you will download the package tidyverse
If you are familiar with RStudio install tidyverse by entering the command into your console:
install.packages("tidyverse")
On Monday we will be going through the tutorial “Manipulating, analyzing and exporting data with tidyverse”
This tutorial uses an example dataset we’ll call surveys. To import this dataset run the following code:
library(readr)
surveys <- read_csv("https://ndownloader.figshare.com/files/2292169")
This will create your first R object, a dataset called “surveys”. All exercises will be run on this dataset.
There are tons of free resources for learning how to use R. For online resources I recommend:
The cheat sheets make it easy to learn about and use some of our favorite packages. They are published in their respective PDF versions here: https://www.rstudio.com/resources/cheatsheets/, some are also available in RStudio under Help-Cheatsheets.
Two suggested cheatsheets for Monday’s tutorial:
R for Data Science by Hadley Wickham, the Buddah of the Tidyverse
I base tutorials around the Data/Software Carpentries: https://datacarpentry.org/lessons/ http://swcarpentry.github.io/r-novice-inflammation/