-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path05-rmarkdown.Rmd
51 lines (39 loc) · 1.14 KB
/
05-rmarkdown.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: "R Markdown Practice"
author: "Angela Li"
date: "2/12/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Data Used
Here is an explanation of the data I used in this analysis:
- [**Library data**](https://data.cityofchicago.org/Parks-Recreation/Waterways/eg9f-z3t6): points
- **Community area data**: polygons
### Rationale for Data
Why I used this data:
1. *Different geometries*
2. *Relevant and interesting*
![](areas_without_libraries.png)
# Load packages
```{r, message=FALSE, warning=FALSE}
library(sf)
library(ggplot2)
library(dplyr)
```
# Read and project data
```{r results='hide'}
areas <- st_read("https://data.cityofchicago.org/resource/igwz-8jzy.geojson")
libraries <- st_read("https://data.cityofchicago.org/resource/psqp-6rmg.geojson")
areas <- st_transform(areas, 32616)
libraries <- st_transform(libraries, 32616)
```
# Make a ggplot!
```{r map, echo=FALSE, fig.height=2, fig.width=2}
ggplot() +
geom_sf(data = areas) +
geom_sf(data = libraries)
```
# A useful shortcut
Use `Ctrl-Alt-I` to insert a code chunk. Or click the "Insert" button at the top of a R Markdown document.