Reputation: 129
Anyone knows how can I plot a US map in R without the states of Alaska and Hawaii?
I have tried with plot_usmap
and ggplot2
, but I can't remove those states from the plot.
Thank you :)
Upvotes: 1
Views: 1941
Reputation: 16178
You can use exclude
argument in plot_usmap
:
library(usmap)
plot_usmap(data = statepop, values = "pop_2015",
exclude = c("AK","HI"))
# Without any fillings:
plot_usmap(exclude = c("AK","HI"))
Using ggplot2
, you can directly load the US states by doing:
library(ggplot2)
us <- map_data("state")
ggplot()+
geom_map(data = us, map = us,
aes(x = long, y = lat, map_id=region))
Upvotes: 2