Tutorial 7: Maps, 2 of 2

Tutorial 7: Maps, 2 of 2

Leah Brooks March 2, 2020

Welcome back to maps! Today is the second of two mapping tutorials. We learn how to make

? choropleth maps ? legends for those maps ? dot density maps

We also learn some useful R programming, including

? pivot_wider(): a command to make long data wide ? how to annotate a chart in R

A. Load Packages and Data

We are using a set of packages that you should have already used in the past. Here I am loading them with require() which installs the package if you do not already have it.

require(sf)

## Loading required package: sf ## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3 require(ggplot2)

## Loading required package: ggplot2 require(dplyr)

## Loading required package: dplyr

## ## Attaching package: dplyr

## The following objects are masked from package:stats :

##

##

filter, lag

## The following objects are masked from package:base :

##

##

intersect, setdiff, setequal, union

require(tidyr)

## Loading required package: tidyr

Like the previous map tutorial class, we'll use crime data. See the Tutorial 5, section D.1. to re-load these data if you need.

1

# we ll use the crime data again c2018 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download