Last active
August 29, 2015 14:20
-
-
Save aaroncharlton/6e3e76907875f4e2e43e 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
# 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