An R package to support the creation of US maps in the R language.
Questions tagged [usmap]
57 questions
2
votes
2 answers
Boxplot for 50 States over time
Edited based on answers
I have data on marriage rates for the 50 states over time. I am trying to make individual box plots for each state and be able to also put these plots on a map of the states in R. If that is not possible, due to congestion, I…

subrinarafiq
- 59
- 1
- 8
2
votes
0 answers
How do I turn this rayshader plot into a Gif?
I made this cool map with rayshader to plot the amount of industrial water use by the county. But I don't know how to go from plot you move with the mouse to a Gif. Here's the code for the non-Gif Rayshader…

matt_lnrd
- 329
- 1
- 9
1
vote
1 answer
How can I draw a boundary line around multiple states in a US map in R?
The R package {usmap} provides a convenient way to create maps of the United States using {ggplot2}.
You can easily draw borders around state boundary lines or even county boundary lines.
For example, here is a basic map of the US generated from…

duckmayr
- 16,303
- 3
- 35
- 53
1
vote
1 answer
In R use plot_usmap with color and geom_scatterpie together
I want to make a map that has color for each state represent an variable. At same time, I want to add a pie chart for each state while keep the color in the last step.
So far, I can make the colored map with plot_usmap
and pie chart on map use…

Sam
- 11
- 1
1
vote
1 answer
Draw map in R with different color markers and legend?
This is what my data looks like:
Data
I want to draw a map for state of Hawaii, where each latitude and longitude is a marker of different color based on the category in dummy, and then a legend based on that dummy column value.
The furthest I have…

MathNoob205
- 23
- 2
1
vote
1 answer
Modify the size of each legend icon in ggplot2
I am using ggplot/usmap libararies to plot highly skewed data onto a map.
Because the data is so skewed, I created uneven interval brackets. See below;
My…

NewBee
- 990
- 1
- 7
- 26
1
vote
0 answers
Insert US State abbreviation on Map togeter numbers with ggplot2
I have the following data set:
Then with this code:
ggplot(data= data.to.work.final, aes(map_id = State_L)) +
geom_map(aes(fill = Suicide_Rate_By_Pop), color= "white", map = fifty_states) +
expand_limits(x = fifty_states$long, y =…

user2626597
- 41
- 7
1
vote
0 answers
Plotting County level data using usmap
thanks for having a look at my question.
I am trying to plot the values on a US map at county level.
This is the data I am using
Fips County Value
01001 Autauga 381.2
1003 Baldwin 366.1
1005 Barbour 547.6
1007 Bibb 501.0
1009 Blount …

Emmanuelle
- 25
- 5
1
vote
1 answer
R: Creating multiple maps using a loop through variable names
I'd like to create a map that shows the value of variable for a given state. The dataset contains around a thousand variables and is at the state level, for about 100 years.
The code I have and works is:
plot_usmap(data = database, values =…

PierreRoubaix
- 167
- 1
- 1
- 7
1
vote
1 answer
Plotting data frame in R using usmap library
I'm new to R and I'm trying to plot a data frame of county values using the usmap library.
I have a dataset containing all the FIPS (county codes) for a particular region and the data (deaths) that I want to show on the map.
This is my first R…

user1274820
- 7,786
- 3
- 37
- 74
1
vote
1 answer
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 in FIP colum, but I am stuck at is how to shade…

Mathica
- 1,241
- 1
- 5
- 17
1
vote
1 answer
Why are these states not displaying the data when the data exists with the usmap package?
I'm trying to plot election results on the US map with the usmap package but even though the dataset is complete, I get plot that shows missing values for some states. The states are greyed out and I'm not sure why this is…

Ben Koschella
- 13
- 3
1
vote
1 answer
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 red, rather than a red gradient. I need the legend…

user1288578
- 411
- 1
- 6
- 15
1
vote
1 answer
Putting Values on a County Map in R
I am using an excel sheet for data. One column has FIPS numbers for GA counties and the other is labeled Count with numbers 1 - 5. I have made a map with these values using the following code:
library(usmap)
library(ggplot2)
library(rio) …

arocha717
- 13
- 4
1
vote
1 answer
code issue: Error in `[.data.frame`(result, , c(setdiff(names(result), names(data)), : undefined columns selected
Hi I created a usmap using
plot_usmap(regions="counties",data=big.covid,values = "density")+
labs(title="Unweighted Density by County")+
theme(panel.background = element_rect(color="black"))+
scale_fill_continuous(low="white",high="darkblue",…

Lynn M
- 21
- 2