Skip to content

Instantly share code, notes, and snippets.

@airalcorn2
Created April 13, 2018 19:28
Show Gist options
  • Save airalcorn2/e074bba876f93519d86b5776f0246cc0 to your computer and use it in GitHub Desktop.
Save airalcorn2/e074bba876f93519d86b5776f0246cc0 to your computer and use it in GitHub Desktop.
Code to generate the plot seen here --> https://www.facebook.com/photo.php?fbid=10103790197221251.
# Michael A. Alcorn
library(ggplot2)
library(plyr)
data <- read.csv("species.csv")
data$Date <- as.Date(data$Date, "%Y-%m-%d")
ggplot(data, aes(Date, Total)) + geom_line() + scale_x_date(date_breaks = "1 month")
state.counts <- count(data$State)
ggplot(state.counts, aes(x = reorder(x, -freq), freq)) + geom_bar(stat = "identity") + labs(x = "State", y = "Count")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment