Files for my Introduction to R and RStudio Hands-On Session at NICAR 2018 on Saturday March 10 at 9 am
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
IntroToR.Rproj
NICAR2018_IntroR.pdf
README.md
config.R
intro.R
salaries.R
try_at_home_geocoding.R

README.md

Intro to R and RStudio

NICAR 2018 Session on Saturday March 10, 9 am

Sharon Machlis

This repo includes R scripts that will be on laptops in my NICAR hands-on session Saturday morning introducing R and RStudio.

I can't predict how many people might show up to a repeat session early on a Saturday morning :-) But if you know that you might want to attend and are worried that you may end up in the room but not at a session laptop, I figured I'd post the files in advance. So, if you are interested in setting up your own laptops in advance for the session, here's how. (Note: You probably want to do this sometime before the session starts, given the vagaries of hotel Internet connections.)

  1. Download R from https://cran.rstudio.com/, choosing the binary distribution for your operating system. Install it as you would any other software program.

  2. Download the free, open-source version of RStudio Desktop (not server) from the RStudio website. Install it as you would any other software program.

  3. Open RStudio. Type the following line of code in the bottom left panel at the > prompt (it may just be one large panel at the left instead of a top and bottom):

install.packages("pacman")

and hit return or enter. This installs an external R library called pacman that's useful for installing other packages.

  1. When that finishes, type the following line of code at the > prompt:
install.packages("usethis")

and hit return or enter. As you might have guessed, that installs an external R library called usethis.

  1. When that finishes, type (or cut and paste) this code at the > prompt:
usethis::use_course("https://github.com/smach/NICAR2018IntroToR/archive/master.zip")

This should download all the session files to your local system, and create a new project for them within RStudio. You'll be asked if you want to proceed with the download (choose yes) and whether you want to subsequently delete the zip file after it's unzipped (you probably do).

RStudio should now open in the directory containing your new project files. If it hasn't, find the IntroToR.Rproj file and click to open that.

  1. At the > prompt in your lower left pane, type:
source("config.R")

and hit return or enter. That should load all the other R packages you need for the session.