xcode-select --install
Assignment 00: Installation
Due by
Getting Started
This is as it were the zeroth assignment for the course. It has several parts. The first part is to install R and RStudio. The second is to set up your GitHub account and connect it to RStudio. The third part is checking to see if you successfully did the first two parts. Finally, I suggest some other, related software you should also install. You should complete this assignment before the first class meeting. I strongly encourage you to talk to your fellow classmates about the assignment and to help each other out.
Task 1: Install R and RStudio
We will be working with the most recent stable versions of R and RStudio, as well as with a number of additional packages. You will need to install R, RStudio, and the necessary packages on your own computer.
Install R on your computer
Begin by installing R (http://cloud.r-project.org). Choose the version appropriate for your computing platform:
If you use macOS with an Apple Silicon processor (i.e. an M-series processor), then install R for macOS’s Apple Silicon build. This version does not work on older, Intel-based Macs.
If you use macOS with an Intel processor, then install R for macOS’s Intel build.
If you use Microsoft Windows, then install R for Windows
If you use Linux, choose your distribution and install the R package for it.
Install RStudio on your computer
If you use macOS (whether Apple Silicon or Intel), install this version of RStudio
If you use Windows, install this version of RStudio
If you use Linux, choose your distribution from the download page
Installing some additional packages
- Once R and RStudio are installed, launch RStudio. Either carefully type in or (better) copy and paste the following lines of code at R’s command prompt. The prompt is located in the RStudio window named “Console”. After you paste the lines in, hit return. In the code below, the
<-
arrow is made up of two keystrokes, first<
and then the short dash or minus symbol,-
.
<- c("tidyverse", "babynames", "broom", "drat", "gapminder",
my_packages "here", "janitor", "naniar", "palmerpenguins", "remotes",
"skimr", "slider", "socviz", "usethis", "visdat","reprex", "tinytex")
install.packages(my_packages, repos = "http://cran.rstudio.com")
# Be patient!
<- paste0("kjhealy/", c("covdata", "congress", "nycdogs", "ukelection2019", "uscenpops"))
data_packages ::install_github(data_packages) remotes
Installing these packages may take a little time.
Task 2: Get set up on GitHub
GitHub is a software development platform and service that is widely used by R Developers. You can read some background on it from an R user’s point of view here.
If you do not have one already, create a GitHub account and obtain a GitHub Personal Access Token. After you have installed R and RStudio, read and carefully follow the instructions here:
- Register a GitHub Account
- Install Git and a Git Client
- Get a Personal Access Token
- Connect to GitHub
Task 3: See if everything works
- Go to this week’s Example and see if you can run the code in the example to the point where you can reproduce the OECD project.
Task 4: Install some other software
Here are some things we will not use immediately, but which you should install now anyway.
Both macOS and Windows
- Manage your references with Zotero. Zotero is a free, open-source reference manager that works well with R and RStudio. It is available for all major operating systems. The sooner you start using it to manage your references, the better.
- In addition to Zotero, you should also install the Zotero Better BibTeX plugin. This plugin allows you to export your Zotero libraries in a format that works well with R and RStudio. It also means you can use Zotero to automatically manage and update your bibliographical files in Quarto documents rather than having to edit a .bib file by hand.
macOS
- If you are on a Mac, install the Developer Command Line Tools if this did not happen already when you installed
git
. To install the command line tools, open a terminal window and type
then hit return. You will see a dialog box asking you to install the command line tools. Go ahead and do so.
- Install Homebrew, a package manager for macOS. Homebrew is useful for installing and managing command-line tools.
Windows
- Install the Windows Terminal if you don’t already have it.
- Then install the WinGet package manager if you don’t already have it.
- Use WinGet to install PowerShell 7. Windows comes installed with an older version of PowerShell (version 5). You can’t remove it, but can install the newer version (version 7) and choose it as your default shell.
- Consider installing Oh My Posh to make your terminal look a little nicer and get a more useful command prompt.