4 Getting Started
4.1 Prerequisites
Basic knowledge of working with datasets in R is essential. This course assumes that you’re comfortable with reading datasets, working with script files, and navigating in RStudio.
4.2 Software Requirements
4.2.1 R and RStudio
Recent versions of R (version 3.2 or newer) and RStudio (version 1.0 above) are required.
You can download the latest versions from the links below:
You can find out the version of R installed by typing version
at the console:
version
_
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 4.2
year 2017
month 01
day 27
svn rev 73369
language R
version.string R version 3.4.2 (2017-01-27)
nickname Short Summer
4.3 Required Packages
This workshop relies on three packages: dplyr
, tidyr
, and readr
. There are two ways to install these packages:
4.3.1 Option 1: Use tidyverse
You can either install these two packages individually or use tidyverse
. The tidyverse
package is a collection of packages used for data manipulation and visualization. In addition to dplyr
, tidyr
, and readr
, it also includes the following:
[1] "broom" "cli" "crayon" "dplyr" "dbplyr"
[6] "forcats" "ggplot2" "haven" "hms" "httr"
[11] "jsonlite" "lubridate" "magrittr" "modelr" "purrr"
[16] "readr" "readxl\n(>=" "reprex" "rlang" "rstudioapi"
[21] "rvest" "stringr" "tibble" "tidyr" "xml2"
[26] "tidyverse"
You can install tidyverse
using the install.packages()
function:
install.packages("tidyverse")
You can find out the version of tidyverse
installed using the packageVersion()
function:
packageVersion("tidyverse")
[1] '1.2.1'
To update tidyverse
packages, you can use the tidyverse_update()
function:
tidyverse::tidyverse_update()
4.3.2 Option 2: Install Individual Packages
If you encounter any problems installing tidyverse
, then the other option is to install dplyr
, tidyr
, and readr
individually.
install.packages("dplyr")
install.packages("tidyr")
install.packages("readr")