Chapter 2 Installation

2.1 Install R

These instructions assume that you have installed the Rstudio program and the R language.

Mac and Windows instructions are available here. Note that you only need to install the R and RStudio programs, not the other program described there.

2.2 Install some additional extensions to R.

R is a statistical environment; although it’s fine on its own, most of the value comes from additional capabilities other people write for it, called packages.

For the workshop, you’ll need to install a few of these.

To install them, you’ll just open Rstudio and cut and paste a few lines into the “console” area on your screen. This will have a > character and a place next to it that blinks for entry.

Rstudio should look something like this

Rstudio should look something like this

You may get a version of Rstudio with four areas, not three; if so, console is probably at the bottom left.

2.2.1 Install core packages

First, there are some core packages that you need to install. For this, just copy and paste the code below into the console.

install.packages("tidyverse")

A lot of text will flash by on the screen. The last line should tell you if it worked or not. You can type library(tidyverse) to see if it loads.

If it doesn’t work, you should read the output, which will tell you what broke. Often, it’s because you need some additional thing installed; some of these programs involve underlying computer languages you may need to install on your system. (If it asks you for something like “developer tools,” follow instructions from it and Google to install.) If you can fix it, that’s great. If not, you might want to e-mail me.

Then, install another package called “devtools” the same way.

install.packages("devtools")

2.2.2 Install wordVectors

Once you’ve installed devtools, you can install wordVectors, which includes the functions we’ll be working with in the workshop.

devtools::install_github("bmschmidt/wordVectors")

2.3 Make sure it works.

You should now be able to run the following two lines in your R console.

library(wordVectors)
library(tidyverse)