20  Installations

You’re going to do things most of you aren’t used to doing with your computer in this class. In order to do that, you need to clean up your computer. I’ve seen what your computer looks like. It’s disgusting.

20.1 Part 1: Update and patch your operating system

On a Mac:

  1. Open System Preferences.

    Depending on how old your Mac OS is, you might see this:

Or you might see this:

  1. Check and see if you have the latest version of the Mac OS installed. If your computer says “Your Mac is up to date”, then you’re good to go, regardless of what comes next.

  2. If you aren’t on Sonoma and you can update to it, you should do it. This will take some time – hours, so don’t do it when you need your laptop – but it’s important for you and your computer to stay up to date on operating systems.

  3. When you’re done, make sure you click the Automatically keep my Mac up to date box and install those updates regularly. Don’t ignore them. Don’t snooze them. Install them.

  4. With an up-to-date operating system, now install the command line tools. To do this, click on the magnifying glass in the top right of the screen and type terminal. Hit enter – the first entry is the terminal app.

  5. In the terminal app, type xcode-select --install and hit enter. Let it run.

On Windows:

  1. Type Updates into the Cortana search then click Check for updates

  1. After the search for updates completes, apply any that you have. Depending on if you’d done this recently or if you have automatic updates set, this might take a long time or go very quickly.

  1. When you’re done, make sure you set up automatic updates for your Windows machine and install those updates regularly. Don’t ignore them. Don’t snooze them. Install them.

20.2 Part 2: Install R and R Studio

  1. Go here. Go to Step 1 and click Download and Install R

    • If you’re on a Mac, click on Download R for MacOS. If you have a newer Mac with an M1/M2/M3 chip, you want the arm64 version. If you’re on an older Mac with an Intel chip, you want the X86_64 version.

    • If you’re on Windows, install the base package AND install Rtools. When either downloads, run the executable and accept the defaults and license agreement.

  2. Go back to here. Go to Step 2 and click R Studio Desktop for your version.

Mac users:

Make sure you drag the R Studio icon into the Applications folder icon.

Windows users:

You can find it by typing RStudio into the Cortana search.

20.3 Part 3: Installing R libraries

  1. Open R Studio. It should show the Console view by default. We’ll talk a lot more about the console later.
  2. Copy and paste this into the console and hit enter:

install.packages(c("tidyverse", "rmarkdown", "lubridate", "janitor", "learnr", "remotes", "devtools", "waffle", "ggrepel", "ggbeeswarm", "ggbump", "ggalt", "ggtext", "rvest"))

20.4 Part 4: Install Slack

  1. Install Slack on your computer and your phone (you can find Slack in whatever app store you use). The reason I want it on both is because you are going to ask me for help with code via Slack. Do not use screenshots unless specifically asked. I want you to copy and paste your code. You can’t do that on a phone. So you need the desktop version. But I can usually solve your problem within a few minutes if you respond right away, and I know that you have your phone on you and are checking it. So the desktop version is for work, the phone version is for notifications.
  2. Email me the address you want connected to Slack. Use one you’ll actually check.
  3. When you get the Slack invitation email, log in to the class slack via the apps, not the website.
  4. Add the #r channel for general help I’ll send to everyone in the channel and, if you want, the #jobstuff channel for news about jobs I come across.

20.5 Part 5: Install the tutorials

To get the tutorials, do the following.

  1. Open R Studio.

  2. R Studio defaults to the console view. This is good, This is where you want to be.

  1. In the console, enter the following:

    devtools::install_github("mattwaite/DataJournalismTutorials", force=TRUE)

  2. You should see some automated output. If you are told there are newer libraries and asked if you want to install them, just hit enter. When it is done, quit R Studio and restart it. This is what it will look like when done.