Skip to main content

Questions tagged [usmap]

An R package to support the creation of US maps in the R language.

0 votes
0 answers
43 views

Interactive R maps that work well on mobile, with inset AK and HI?

Issue: I need an interactive choropleth map of the US that will work well on mobile (ideally pinch-zoom), has a pop-up on tap/click, and has AK and HI set below. Plotly isn't it as you have to tap the ...
0 votes
1 answer
32 views

Error when using usmap package with geom_point

I'm trying to plot the locations of various stations across the U.S. with color of the point corresponding to a certain category. Some of these locations are outside of the continental U.S. (...
1 vote
1 answer
52 views

Plotting old Connecticut county regions in USMAP

Recently, the American Census Bureau changed the geographical entities reported in the state of Connecticut, as discussed here. Previously, data was reported in the following 8 counties: CT_counties &...
0 votes
2 answers
50 views

Drawing state boundaries in county map in recent version

Using usmap, I have made a plot of values by US counties from some values stored in a variable county. Before I recently updated R and all my packages, I could easily create a county map with thick ...
1 vote
2 answers
310 views

Error when running code examples from usmap r package

I have updated my R to the newest version. Cleared my R environment. I am trying to run this simple code using the usmap package, but keep getting this error. plot_usmap(data = statepop, values = &...
1 vote
1 answer
225 views

Map of New York State counties with binned colors and legend

I am trying to make a county-level map of the state of New York. I would like to color each county based on their level of unionization. I need the map and legend to have four discrete colors of ...
1 vote
1 answer
459 views

how to plot specific US counties using their FIP with a gradient effect on single map

I have dataframe below: mydf <- data.frame(FIP=c(1017,1059,1061,1133,5103,12129,13123,12129), val=c(100,100,225,400,180,278,180,321)) I want to shade US counties on one single map whose FIPs are ...
2 votes
1 answer
3k views

Discrete values in US map legend using plot_usmap

I am plotting a group of "treatment" counties, using usmap::plot_usmap(), such that treatment=1 for the identified counties an 0 otherwise. I would like the legend to reflect the fact that the ...
0 votes
1 answer
739 views

usmaps R: Use ggplot2 to set bins and manually color

I am using the usmaps() package in R to create a map of the US. I have data set up like so: Ces_State_Only: State 1990 Alabama 0.2 Alaska 0.31 Arizona 0.40 I want to create a chloropleth map. I ...
3 votes
2 answers
3k views

How to label numbers instead of names using usmap?

I know usmap has an option label in plot_usmap(). Instead of state names, I want to label some numbers. I guess there should be data related to the coordinate of the state centroids in usmap but I am ...
0 votes
1 answer
122 views

Is there a way in which I can overlay state boundaries with county maps in the usmap R package?

I am trying to have the state boundaries clearly demarcated along with the county wise heat maps. But the state boundaries do not seem prominent. I have tried a couple of different code chunks but ...
0 votes
2 answers
63 views

geom_facet with scales = 'free_y' generates y-axis texts in empty plots

I have a following ggplot2 R code that creates state-specific plot using geofacet package: ggplot(plotdf, aes(x = year, y = value)) + geom_line(aes(color = group1), linewidth = 0.6) + ...
1 vote
1 answer
97 views

Error message when converting usmap object to sf object

I am attempting to create a map with county level data in several US states. Since I'm including Alaska, I cannot use the maps::map() function and have elected to use the usmap::us_map() function. The ...
0 votes
1 answer
39 views

Why is plot_usmap not displaying properly on secure server?

I wrote a script to show the number of events in a given county. On my local machine, it displays properly and looks great! But when I run the exact same code on the exact same dataset on a secure ...
7 votes
2 answers
10k views

Add points to usmap with ggplot in r

I was able to create a US map with this tutorial. When I tried to add additional points to it they all ended up in South Dakota, no matter what I input for data. library(ggplot2) library(usmap) ...

15 30 50 per page
1
2 3 4 5