choroplethr basics - census.gov · module 2 author: u.s. census bureau created date:...

30
Choroplethr Basics Ari Lamstein

Upload: others

Post on 16-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr BasicsAri Lamstein

Page 2: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Course Outline

1. Introduction

2. Choroplethr Basics

3. Variables and Vintages

4. Data Details

5. Learning More

Page 3: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps

Page 4: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps

Page 5: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

library(choroplethr) library(choroplethrMaps)

Page 6: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

VerificationCheckmark means “loaded”

Page 7: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

install.packages vs. libraryRun library each time you load Rstudio

Page 8: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps

Page 9: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

?df_pop_state? Means “help”

Page 10: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

data(df_pop_state)Load the data

Page 11: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

View(df_pop_state)Click “region” and “value” to sort

Page 12: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps

Page 13: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state)?state_choropleth

Page 14: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

(region, value) pairs

Page 15: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps

Page 16: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

?state_choropleth

Page 17: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Customizing Maps

• Title and legend

• Scale

• Zoom

• Reference map

Page 18: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state)

Page 19: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, title = "2012 State Population Estimates", legend = "Population")

Page 20: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Customizing Maps

• Title and legend

• Scale

• Zoom

• Reference map

Page 21: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, num_colors = 7)

Page 22: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, num_colors = 2)

Page 23: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, num_colors = 1)

Page 24: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Customizing Maps

• Title and legend

• Scale

• Zoom

• Reference map

Page 25: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, zoom = c(“california”, “oregon”, “washington”))

Page 26: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

?state.regions

Page 27: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Customizing Maps

• Title and legend

• Scale

• Zoom

• Reference map

Page 28: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, zoom = c(“california”, “oregon”, “washington”))

Page 29: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

state_choropleth(df_pop_state, num_colors = 1, zoom = c(“california”, “oregon”, “washington”), reference_map = TRUE)

Page 30: Choroplethr Basics - Census.gov · Module 2 Author: U.S. Census Bureau Created Date: 20190428182247Z

Choroplethr Basics

• Loading the package

• Viewing example data

• Mapping example data

• Customizing maps