Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
update for sp22
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Prener committed Feb 7, 2022
1 parent 1941abf commit 71bdad5
Show file tree
Hide file tree
Showing 33 changed files with 6,132 additions and 1,605 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module-1-cartography <img src="https://slu-soc5650.github.io/images/icon_hu137d436a85c84cab921c9c47edaed5ef_12382_192x192_fill_lanczos_center_2.png" align="right" />
===========================================================
[![](https://img.shields.io/badge/semester-spring%2021-blue.svg)](https://github.com/slu-soc5650/module-1-cartography)
[![](https://img.shields.io/badge/semester-spring%2022-blue.svg)](https://github.com/slu-soc5650/module-1-cartography)
[![](https://img.shields.io/badge/release-full-brightgreen.svg)](https://github.com/slu-soc5650/module-1-cartography)
[![](https://img.shields.io/github/release/slu-soc5650/module-1-cartography.svg?label=version)](https://github.com/slu-soc5650/module-1-cartography/releases)
[![](https://img.shields.io/github/last-commit/slu-soc5650/module-1-cartography.svg)](https://github.com/slu-soc5650/module-1-cartography/commits/master)
[![](https://img.shields.io/github/repo-size/slu-soc5650/module-1-cartography.svg)](https://github.com/slu-soc5650/module-1-cartography)

## Module 1 - Course Introduction
These materials correspond to the third course meeting of SOC 4650 and SOC 5650.
These materials correspond to Meeting 1-2 for SOC 4650 and SOC 5650.

## Lesson Quick Start
### Install Software
Expand Down
477 changes: 0 additions & 477 deletions assignments/lab-03-replication/docs/lab-03-replication.nb.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Lab-03 Replication"
title: "Lab 1-3 Replication"
author: "Christopher Prener, Ph.D."
date: '(`r format(Sys.time(), "%B %d, %Y")`)'
output:
Expand All @@ -9,7 +9,7 @@ always_allow_html: yes
---

## Introduction
This notebook provides a replication of Lab-03.
This notebook provides a replication of Lab 1-3.

## Dependencies
This notebook requires the following packages:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Lab-03 Replication
Lab 1-3 Replication
================
Christopher Prener, Ph.D.
(February 15, 2021)
(February 07, 2022)

## Introduction

This notebook provides a replication of Lab-03.
This notebook provides a replication of Lab 1-3.

## Dependencies

Expand All @@ -14,25 +14,25 @@ This notebook requires the following packages:
``` r
# tidyverse packages
library(ggplot2) # static mapping

# mapping packages
library(mapview) # preview spatial data
```

## GDAL version >= 3.1.0 | setting mapviewOptions(fgb = TRUE)
## Warning in register(): Can't find generic `scale_type` in package ggplot2 to
## register S3 method.

``` r
# mapping packages
library(mapview) # preview spatial data
library(sf) # spatial tools
```

## Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1
## Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE

``` r
# other packages
library(here) # file path management
```

## here() starts at /Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication
## here() starts at /Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication

``` r
library(RColorBrewer) # color brewer palettes
Expand All @@ -58,59 +58,69 @@ number of different layers:
stl_boundary <- st_read(here("data", "STL_BOUNDARY_City.geojson"))
```

## Reading layer `STL_BOUNDARY_City' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication/data/STL_BOUNDARY_City.geojson' using driver `GeoJSON'
## Reading layer `STL_BOUNDARY_City' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication/data/STL_BOUNDARY_City.geojson'
## using driver `GeoJSON'
## Simple feature collection with 1 feature and 2 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 733360 ymin: 4268394 xmax: 746157.1 ymax: 4295511
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 733360 ymin: 4268394 xmax: 746157.1 ymax: 4295511
## Projected CRS: NAD83 / UTM zone 15N

``` r
# water layers
il_hydro <- st_read(here("data", "IL_HYDRO_Mississippi.geojson"))
```

## Reading layer `IL_HYDRO_Mississippi' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication/data/IL_HYDRO_Mississippi.geojson' using driver `GeoJSON'
## Reading layer `IL_HYDRO_Mississippi' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication/data/IL_HYDRO_Mississippi.geojson'
## using driver `GeoJSON'
## Simple feature collection with 4 features and 8 fields
## geometry type: POLYGON
## dimension: XY
## bbox: xmin: 739063 ymin: 4268279 xmax: 746617.9 ymax: 4295339
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: 739063 ymin: 4268279 xmax: 746617.9 ymax: 4295339
## Projected CRS: NAD83 / UTM zone 15N

``` r
stl_hydro <- st_read(here("data", "STL_HYDRO_AreaWater.geojson"))
```

## Reading layer `STL_HYDRO_AreaWater' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication/data/STL_HYDRO_AreaWater.geojson' using driver `GeoJSON'
## Reading layer `STL_HYDRO_AreaWater' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication/data/STL_HYDRO_AreaWater.geojson'
## using driver `GeoJSON'
## Simple feature collection with 16 features and 2 fields
## geometry type: POLYGON
## dimension: XY
## bbox: xmin: 733468.5 ymin: 4268394 xmax: 746157.1 ymax: 4295418
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: 733468.5 ymin: 4268394 xmax: 746157.1 ymax: 4295418
## Projected CRS: NAD83 / UTM zone 15N

``` r
# highways
highways <- st_read(here("data", "STL_TRANS_PrimaryRoads", "STL_TRANS_PrimaryRoads.shp"))
```

## Reading layer `STL_TRANS_PrimaryRoads' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication/data/STL_TRANS_PrimaryRoads/STL_TRANS_PrimaryRoads.shp' using driver `ESRI Shapefile'
## Reading layer `STL_TRANS_PrimaryRoads' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication/data/STL_TRANS_PrimaryRoads/STL_TRANS_PrimaryRoads.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 9 features and 4 fields
## geometry type: MULTILINESTRING
## dimension: XY
## bbox: xmin: 733482 ymin: 4270554 xmax: 745666.9 ymax: 4294751
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: MULTILINESTRING
## Dimension: XY
## Bounding box: xmin: 733482 ymin: 4270554 xmax: 745666.9 ymax: 4294751
## Projected CRS: NAD83 / UTM zone 15N

``` r
# owner occupied housing
housing <- st_read(here("data", "STL_HOUSING_OwnerOccupied.geojson"))
```

## Reading layer `STL_HOUSING_OwnerOccupied' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/assignments/lab-03-replication/data/STL_HOUSING_OwnerOccupied.geojson' using driver `GeoJSON'
## Reading layer `STL_HOUSING_OwnerOccupied' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/assignments/lab-1-3-replication/data/STL_HOUSING_OwnerOccupied.geojson'
## using driver `GeoJSON'
## Simple feature collection with 106 features and 5 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 733360 ymin: 4268410 xmax: 746170.8 ymax: 4295511
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 733360 ymin: 4268410 xmax: 746170.8 ymax: 4295511
## Projected CRS: NAD83 / UTM zone 15N

We’re now ready to map these data.

Expand Down Expand Up @@ -149,7 +159,7 @@ p1 <- ggplot() +
p1
```

![](lab-03-replication_files/figure-gfm/housing-map-1.png)<!-- -->
![](lab-1-3-replication_files/figure-gfm/housing-map-1.png)<!-- -->

The map shows that owner occupied rates are highest in the southwest
portion of St. Louis. We’ll save it using the following code:
Expand Down
1,939 changes: 1,939 additions & 0 deletions assignments/lab-1-3-replication/docs/lab-1-3-replication.nb.html

Large diffs are not rendered by default.

Binary file renamed assignments/lab-03.pdf → assignments/lab-1-3.pdf
Binary file not shown.
561 changes: 0 additions & 561 deletions examples/meeting-03-complete.nb.html

This file was deleted.

495 changes: 0 additions & 495 deletions examples/meeting-03.nb.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Meeting-03 Meeting Notebook - Complete"
title: "Meeting 1-3 Notebook - Complete"
author: "Christopher Prener, Ph.D."
date: '(`r format(Sys.time(), "%B %d, %Y")`)'
output:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Meeting-03 Meeting Notebook - Complete
Meeting 1-3 Notebook - Complete
================
Christopher Prener, Ph.D.
(February 15, 2021)
(February 07, 2022)

## Introduction

Expand All @@ -14,25 +14,25 @@ This notebook requires the following packages:
``` r
# tidyverse packages
library(ggplot2) # static mapping

# mapping packages
library(mapview) # preview spatial data
```

## GDAL version >= 3.1.0 | setting mapviewOptions(fgb = TRUE)
## Warning in register(): Can't find generic `scale_type` in package ggplot2 to
## register S3 method.

``` r
# mapping packages
library(mapview) # preview spatial data
library(sf) # spatial tools
```

## Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1
## Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE

``` r
# other packages
library(here) # file path management
```

## here() starts at /Users/chris/GitHub/slu-soc5650/content/module-1-cartography
## here() starts at /Users/prenercg/GitHub/slu-soc5650/module-1-cartography

``` r
library(RColorBrewer) # color brewer palettes
Expand Down Expand Up @@ -62,34 +62,40 @@ are included in the `data/exercise_data` folder:
city <- st_read(here("data", "STL_BOUNDARY_City.geojson"))
```

## Reading layer `STL_BOUNDARY_City' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/data/STL_BOUNDARY_City.geojson' using driver `GeoJSON'
## Reading layer `STL_BOUNDARY_City' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/data/STL_BOUNDARY_City.geojson'
## using driver `GeoJSON'
## Simple feature collection with 1 feature and 2 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 733360 ymin: 4268394 xmax: 746157.1 ymax: 4295511
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 733360 ymin: 4268394 xmax: 746157.1 ymax: 4295511
## Projected CRS: NAD83 / UTM zone 15N

``` r
nhood <- st_read(here("data", "exercise_data", "STL_DEMOGRAPHICS_Nhoods", "STL_DEMOGRAPHICS_Nhoods.shp"))
```

## Reading layer `STL_DEMOGRAPHICS_Nhoods' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/data/exercise_data/STL_DEMOGRAPHICS_Nhoods/STL_DEMOGRAPHICS_Nhoods.shp' using driver `ESRI Shapefile'
## Reading layer `STL_DEMOGRAPHICS_Nhoods' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/data/exercise_data/STL_DEMOGRAPHICS_Nhoods/STL_DEMOGRAPHICS_Nhoods.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 79 features and 5 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 733361.8 ymin: 4268512 xmax: 745417.9 ymax: 4295501
## projected CRS: UTM_Zone_15_Northern_Hemisphere
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 733361.8 ymin: 4268512 xmax: 745417.9 ymax: 4295501
## Projected CRS: UTM_Zone_15_Northern_Hemisphere

``` r
historic <- st_read(here("data", "exercise_data", "STL_HISTORICAL_Districts", "STL_HISTORICAL_Districts.shp"))
```

## Reading layer `STL_HISTORICAL_Districts' from data source `/Users/chris/GitHub/slu-soc5650/content/module-1-cartography/data/exercise_data/STL_HISTORICAL_Districts/STL_HISTORICAL_Districts.shp' using driver `ESRI Shapefile'
## Reading layer `STL_HISTORICAL_Districts' from data source
## `/Users/prenercg/GitHub/slu-soc5650/module-1-cartography/data/exercise_data/STL_HISTORICAL_Districts/STL_HISTORICAL_Districts.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 102 features and 4 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 734470.2 ymin: 4269761 xmax: 745405.8 ymax: 4288348
## projected CRS: NAD83 / UTM zone 15N
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 734470.2 ymin: 4269761 xmax: 745405.8 ymax: 4288348
## Projected CRS: NAD83 / UTM zone 15N

## Manually Applying Colors

Expand All @@ -110,7 +116,7 @@ p1 <- ggplot() +
p1
```

![](meeting-03-complete_files/figure-gfm/historic-districts-1-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/historic-districts-1-1.png)<!-- -->

Now, take a moment and use [ColorHexa.com](https://www.colorhexa.com) to
change the fill to a *cool* color and select a darker shade of gray for
Expand All @@ -128,7 +134,7 @@ p2 <- ggplot() +
p2
```

![](meeting-03-complete_files/figure-gfm/historic-districts-2-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/historic-districts-2-1.png)<!-- -->

## Layering with ggplot2

Expand All @@ -150,7 +156,7 @@ p3 <- ggplot() +
p3
```

![](meeting-03-complete_files/figure-gfm/historic-districts-3-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/historic-districts-3-1.png)<!-- -->

Next, we’ll overlay the historic districts on the City’s neighborhood
boundaries to add some additional context. We’ll set the fill for the
Expand All @@ -174,7 +180,7 @@ p4 <- ggplot() +
p4
```

![](meeting-03-complete_files/figure-gfm/historic-districts-4-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/historic-districts-4-1.png)<!-- -->

## Thematic Mapping with viridis and Color Brewer

Expand All @@ -199,7 +205,7 @@ p5 <- ggplot() +
p5
```

![](meeting-03-complete_files/figure-gfm/nhood-pop-1-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/nhood-pop-1-1.png)<!-- -->

The viridis package contains four other palettes: “magma”, “plasma”, and
“inferno” all look somewhat similar, and then the alternate “cividis”
Expand All @@ -221,7 +227,7 @@ p6 <- ggplot() +
p6
```

![](meeting-03-complete_files/figure-gfm/nhood-pop-2-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/nhood-pop-2-1.png)<!-- -->

This map is a bit hard to read because the color ramp is continuous. We
can bin our data using one of a number of algorithms - “equal”,
Expand Down Expand Up @@ -249,7 +255,7 @@ p7 <- ggplot() +
p7
```

![](meeting-03-complete_files/figure-gfm/nhood-pop-3-1.png)<!-- -->
![](meeting-1-3-complete_files/figure-gfm/nhood-pop-3-1.png)<!-- -->

You can use the `display.brewer.all()` function to get a preview of
other options in the `RColorBrewer` package. Take a few minutes to
Expand Down
2,053 changes: 2,053 additions & 0 deletions examples/meeting-1-3-complete.nb.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/meeting-03.Rmd → examples/meeting-1-3.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Meeting-03 Meeting Notebook"
title: "Meeting 1-3 Notebook"
author: "Christopher Prener, Ph.D."
date: '(`r format(Sys.time(), "%B %d, %Y")`)'
output:
Expand Down Expand Up @@ -163,4 +163,4 @@ p7 <- ggplot() +
p7
```

You can use the `display.brewer.all()` function to get a preview of other options in the `RColorBrewer` package. Take a few minutes to modify `p7` using different palette options and approaches to making breaks.
You can use the `display.brewer.all()` function to get a preview of other options in the `RColorBrewer` package. Take a few minutes to modify `p7` using different palette options and approaches to making breaks.
2,052 changes: 2,052 additions & 0 deletions examples/meeting-1-3.nb.html

Large diffs are not rendered by default.

0 comments on commit 71bdad5

Please sign in to comment.