Clipping ggplot2 map by longitude R

236 Views Asked by At

I want to make a map of the Eastern U.S., however only within the longitude range of -95 degrees to -66.5 degrees I've started using ggplot2.

library(ggplot2)
us_map <- map_data('usa')
map <- ggplot(data=us_map, aes(x=long, y=lat, group=group)) + geom_polygon(fill = 'black')
map

which generates this map: enter image description here

I would like to clip the map to only -95 degrees to -66.5 degrees. I used to do this with the coord_proj function within ggalt package like this:

map <- map + coord_proj("+proj=cea +lat_ts=37.5",ylim = c(25,50), xlim = c(-95,-66.5)) #crib map to eastern US.

However this now throws the error, Error: Not implemented.

Suggestions?

0

There are 0 best solutions below