Questions tagged [choroplethr]

An R package to provide a framework to create choropleth maps in R.

91 questions
19
votes
1 answer

Making a zip code choropleth in R using ggplot2 and ggmap

I am trying to make a choropleth of very simple data, and it's kind of a pain in the neck. I have the following zip codes in the Eastern USA. This is made up data but you get the idea. Zip Freq 11101 10 10014 15 11238 400 etc. for about…
garson
  • 1,505
  • 3
  • 22
  • 56
11
votes
1 answer

setting breaks and labels in ggplot

I have put together the Shiny app (below), showing a choropleth, which looks good except for the scientific notation on the legend. I would like the values to read: '$5,000,000', and '$4,000,000', etc, etc. The code boils down to g…
tumultous_rooster
  • 12,150
  • 32
  • 92
  • 149
9
votes
2 answers

Overlay multiple riverplots (Sankey diagrams) on a map of the world

The fascinating chart below is in the Economist, Jan. 30, 2016 at 61. It depicts exports of liquified natural gas (LNG) from five regions to six regions. How can R draw something similar to it, perhaps with several Sankey diagrams (from the…
lawyeR
  • 7,488
  • 5
  • 33
  • 63
7
votes
1 answer

Alaska and Hawaii not formatting correctly for County Choropleth Map in R

I am trying to format a Choropleth Map of the United States to a specific color and unfortunately, when using scale_fill_brewer to change the color; only 48 of the states do (Hawaii and Alaska do not). Is it possible to know if I can implement the…
aselvendran
  • 105
  • 2
  • 9
6
votes
1 answer

choroplethr: Plotting MSA-level maps?

My question relates to plotting a whole U.S. map on MSA level via choroplethr and choroplethrZip. In the example below, we plot 1) Census population information on a U.S. map on county level and 2) a zoomed map of a selected…
Christopher
  • 2,120
  • 7
  • 31
  • 58
6
votes
1 answer

Roads and Radius Circles in choroplethr, ggmap, or ggplot2

I'm using library(choroplethr) for some market analysis and I have some questions about making my county_choropleth and either overlaying it on top of a ggmap() or using reference_map=TRUE in my code. What I'm trying to do is take my county…
medavis6
  • 843
  • 10
  • 32
4
votes
1 answer

Is there a way in R to move all my labels off the map (into the margins)?

I am working on creating a choropleth map in R with certain cities and certain providers plotted as points on top of the map. I'm stuck with getting the names of the providers to move off the map into the margins (either at the top, to the right, or…
mkelley
  • 105
  • 5
4
votes
1 answer

Shading counties using FIPS code in R map

I am looking for a way to shade counties on the US maps in R. I have list of numeric/char county FIPS code that I can input as parameter. I just need to highlight these counties -- so would just need to shade them and there are no values or…
rajvijay
  • 1,641
  • 4
  • 23
  • 28
3
votes
3 answers

Is there an operator to use in the place of the '+' sign for the function coord_map()?

I recently got into R programming for spatial analysis and was trying to run code to create a projected map using an orthographic projection. Thing, is, I cannot get past the '+' sign. Here's the code and…
THUSH2898
  • 33
  • 3
3
votes
1 answer

Display values corresponding to the USA states over the state name

I was trying to create the US states map using the package "choroplethr" and using a simple df2 data set (it has the same region and values column) and I used the code provided in package document. require (choroplethr) data("df_pop_state") df2…
Adrienne
  • 33
  • 6
3
votes
1 answer

What is the format for state names in Choroplethr?

I'm trying to create a Choropleth of a county using tracts as units. Where it says "state_name", I have no idea what to put. I've tried OH, OHIO, and the FIPS codes. tract_choropleth(df, ohio, title = "census", legend = "",) Each result ends with…
Tazz
  • 31
  • 2
3
votes
1 answer

tract_choropleth for NY data

I'm trying to replicate the map shown in Ari's ACS talk using tract_choropleth. However, the codes keep returning an Error message. I have requested the api key and other functions like state_choropleth() and county_choropleth() were working just…
Rosemary
  • 95
  • 1
  • 9
3
votes
1 answer

Counties within One State Choropleth Map

I'm struggling to customize and find the right code to structure the choropleth map that I am attempting to make of profit of a business by county in a specific state. What I have done so far is be able to plot my code, albeit with a color palette…
medavis6
  • 843
  • 10
  • 32
2
votes
0 answers

R Chorpleth Plotly Colorscale Keeps Resetting to Default when Moving through Frames

I'm currently making a choropleth map in plotly that tracks the population of ever US state from 1910 - 2020. The data is sorted into categorical variables with the percent change of every state in a decade. When I run my code the first year (1910)…
2
votes
0 answers

How to add a county outline on top of a zip choropleth google map?

I've created a choropleth map in R. But I'm being asked if it's possible to add an outline for the county to the map. My issue is that the map has to be overlayed on a google map, so every time I try to just add the black outline it doesn't work. I…
mkelley
  • 105
  • 5
1
2 3 4 5 6 7