Skip to content

Instantly share code, notes, and snippets.

@hannahflaherty
Created November 11, 2019 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannahflaherty/ce009db078c4731c1cd40c4b46b7b73e to your computer and use it in GitHub Desktop.
Save hannahflaherty/ce009db078c4731c1cd40c4b46b7b73e to your computer and use it in GitHub Desktop.
---
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