Skip to content

Instantly share code, notes, and snippets.

@aaroncharlton
Last active August 29, 2015 14:20
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 aaroncharlton/6e3e76907875f4e2e43e to your computer and use it in GitHub Desktop.
Save aaroncharlton/6e3e76907875f4e2e43e to your computer and use it in GitHub Desktop.
# here is the data:
# http://www.ams.usda.gov/AMSv1.0/getfile?dDocName=STELPRDC5087258
# You'll need to remove the first two lines and save a .csv file
setwd("C:/Users/abc/Downloads")
markets <- read.csv("farmers-market.csv")
OR.markets <- markets %>%
filter(State=="Oregon")
require(ggplot2)
require(ggmap)
lats <- OR.markets$y
lons <- OR.markets$x
library(dplyr)
Seafood <- OR.markets$Seafood
df <- as.data.frame(cbind(lons,lats))
library(maps)
Oregon.map <- map_data("state", region="Oregon")
ggplot() +
geom_polygon(data=Oregon.map, aes(x=long, y=lat, group = group),
colour="grey", fill="white" ) +
geom_point(data = df, aes(x = lons, y=lats, alpha = 0.2, colour=Seafood), size = 2, shape = 16) +
guides(fill=FALSE, alpha=FALSE, size=FALSE) +
ggtitle("Oregon Farmer's Markets")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment