Created
November 11, 2019 16:49
-
-
Save hannahflaherty/ce009db078c4731c1cd40c4b46b7b73e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Tidy Squirrels" | |
output: html_notebook | |
--- | |
```{r, message=FALSE} | |
library(readr) | |
library(dplyr) | |
library(ggplot2) | |
library(nationalparkcolors) #https://github.com/katiejolly/nationalparkcolors | |
pal <- park_palette("MtRainier") | |
nyc_squirrels <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-29/nyc_squirrels.csv") | |
``` | |
```{r} | |
nyc_squirrels %>% summary() | |
``` | |
```{r, warning = FALSE} | |
ggplot(nyc_squirrels %>% filter(!is.na(primary_fur_color)), aes(x = long, y = lat, colour = primary_fur_color)) + | |
geom_point(alpha = .6) + | |
coord_fixed(ratio = 1.3) + # ratio of latitude to longitude (y to x) at 41 degrees of latitude | |
theme_minimal() + | |
theme(panel.grid = element_blank(), | |
axis.title = element_blank(), | |
axis.text = element_blank()) + | |
facet_grid(.~shift) + | |
scale_color_manual(values = park_palette("GeneralGrant")[c(5,2,6)]) + | |
labs(title = "Central Park Squirrel Sighting Density", | |
subtitle = "By color and time of day") | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment