Week 5
Introduction to ggplot2 II

SOCI 269

Sakeef M. Karim
Amherst College

AN INTRODUCTION TO QUANTITATIVE SOCIOLOGY—CULTURE AND POWER

Visualizing Data in III—
February 25th

Updates and Reminders

Coding Assignment Deadline

Your coding assignments are due by 8:00 PM on Monday, March 10th.

Updates and Reminders

Assignment instructions are available online.

Extending ggplot2

Getting Started

Today, we’re going to be working with the following script file:

Let’s Move to RStudio

Note

The rest of today’s session will take place in RStudio!

Extra: Colour Palettes

Feel free to search for additional colour palettes using the table below!

“Homework”

Access Census APIs

You’ll need to obtain valid API keys to use the tidycensus and cancensus libraries on Thursday.

  • Instructions for obtaining a CensusMapper API key (to access cancensus data)—and storing it on your system—can be found here.

  • Instructions for obtaining an API key from the US Census Bureau—and storing it on your system—can be found here.

Visualizing Data in IV—
February 27th

Brief Update

Assignment instructions have been slightly tweaked.

A Reminder

Module 1 Ends Today

Starting next week, we will move to Module 2 of the course.

Mapping in ggplot2

Getting Started

Launch RStudio and run the following code:

# NEW PACKAGES ------------------------------------------------------------

week5_packages <- c("scales", "patchwork", "htmltools",  "leafpop", "leaflet", 
                    "mapview", "usmapdata", "usmap", "mapcan", "cancensus",
                    "tidycensus", "geojsonsf", "tidygeocoder",  
                    "rnaturalearthdata", "rnaturalearth", "ggspatial", 
                    "terra", "sp", "sf", "gt", "colorspace")

install.packages(week5_packages)

Give me a when all the packages have been installed.

Getting Started

Today, we’re going to be working with the following script file:

Our Data

Let’s Move to RStudio

Note

The rest of today’s session will take place in RStudio!

Extra: Map Projections

Have a Fun Weekend