Questions tagged [choroplethr]
An R package to provide a framework to create choropleth maps in R.
88
questions
1
vote
1
answer
64
views
Fewer colors than specified by num_colors in choroplethr
num_colors often doesn't seem to be respected. A simple case of 9 states with 7 different values:
> df
region value
1 alabama 1
2 wyoming 5
3 arizona 5
4 arkansas 5
...
2
votes
0
answers
41
views
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 ...
2
votes
0
answers
95
views
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 ...
3
votes
3
answers
67
views
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 ...
1
vote
1
answer
103
views
How to show the zip codes when using zip_choropleth?
I've created a choropleth map of zip codes within a given county. However, I'm being asked to label all the zip codes (it might be cluttered but this is what they want to see). Is there a way to add ...
1
vote
0
answers
33
views
Adding Variable Values & County Names using County_ChoroplethR
I've created a country choroplethR to display data and works fine, what I want to do, is add County Names, and a Variable additional Data (Number of Employees) in additional to the Fill on salary data ...
4
votes
1
answer
160
views
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 ...
2
votes
2
answers
92
views
Object 'value' not found when trying to add border color to choroplethr county map
I want to add black borders to a county choropleth map I have created of New Jersey. Here is my current code:
county_choropleth(tni_data,
state_zoom = "new jersey",
...
1
vote
1
answer
103
views
choroplethr package in R will not load [duplicate]
Loading required package: acs
Loading required package: stringr
Loading required package: XML
Attaching package: ‘acs’
The following object is masked from ‘package:base’:
apply
Error: package or ...
1
vote
1
answer
63
views
Creating more than 9 breaks for discrete data in choropleth package in R
Based on the documentation provided, the set_num_colors command maxed out at 9 breaks for discrete variables in the choropleth package.
Is there anyway to go around this?
Thank you
choro <- ...
2
votes
0
answers
97
views
How to customise choropleth map tooltips in R shiny app
I have tried to customise my choropleth map tooltips in R shiny app, which doesn't work. I tried both paste0 and paste, and it does not work either.
Here is my code:
ui <- fixedPage(
titlePanel(&...
0
votes
1
answer
135
views
Legend not showing up in choropleth when I make the plot using $legend
managerLeftWrong$title = "Profession Subject, Left Map, Inumerate"
managerLeftWrong$legend= "% Evacuated"
managerLeftWrong$ggplot_scale = scale_fill_gradientn(colors = c("...
0
votes
1
answer
134
views
Adjusting font and other graphical parameters in Choroplethr
I am using the Choroplethr package to generate some maps for a forthcoming publication. Does anyone know how to adjust the graphical parameters of the outputted graphics? (Specifically, I am hoping to ...
0
votes
1
answer
120
views
Problems Installing choroplethrZip@v1.5.0 3.5 R
Using the below code I got
install.packages("devtools")
library(devtools)
install_github('arilamstein/choroplethrZip@v1.5.0')
I'm trying to load this package but keep getting this error
...
0
votes
1
answer
458
views
Click event in not working on D3 US Map, and mouseover event is working on particular states only
I refer this chart code reference to draw this chart.
In this code I wrote click event like svg.append("g").on("click", function(d){console.log(d.id)}. But it is not working.
Click ...
2
votes
1
answer
2k
views
How can I bin the legend of a continuous variable in ggplot2?
I'm trying to make a choropleth map of counties in the US. My values have a large range, and are highly 0 inflated, so I would like to create custom bins for the legend and coloring. Ideally this ...
1
vote
1
answer
257
views
Assigning colors to table values using Choroplethr
I'm trying to use choroplethr to make a map at the county level. Currently, I have 3 categorical integers (1, 2, 3) in my csv under the column value which vary depending on each county. The region ...
3
votes
1
answer
1k
views
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.
...
1
vote
2
answers
292
views
How to Remove State Abbreviations from a Choroplethr Map
I'm working with a choroplethr map like the one below. How do I simply remove the state abbreviations?
Here is the replication code:
library(choroplethr)
library(choroplethrMaps)
data(df_pop_state)
...
1
vote
1
answer
66
views
Is there anyway to set the counties' border line colors in county_choropleth? Or any other alternative way?
My data includes FIPS code, County Name, and Population size. Using the choroplethr package, my current code is
county_choropleth(Countydata, legend = "Population",county_zoom =TennCounties)
Is ...
0
votes
2
answers
989
views
How to select specific countries to make a choropleth map
I'm trying to make a choropleth map of some specific countries. I have the data with values for the choropleth map, and the other countries that I don't have data will be plotted in grey.
So here is ...
1
vote
0
answers
79
views
Display error while modifying the hoverinfo of the choropleth maps using ggplotly and choroplethrZip package in R
I tried to modify the hoverinfo using style function of plotly and end up displaying the entire column information on every hover point.
I tried to use style function using <\n>, "br", "br /" and ...
1
vote
1
answer
88
views
Choroplethr produces no graphical output that I can see when reference_map = TRUE
This code draws the stock choroplethr map as it should:
ca_tract_choropleth(df_ca_tract_demographics,
+ title = "2013 Los Angeles Census Tract\n Percent White",
+ legend = "%",
...
0
votes
1
answer
549
views
Trouble installing Choroplethr for R version 3.5.0
I'm not able to install the Choroplethr package.
I've installed the 'devtools' package and the GitHub repo
install_github('arilamstein/choroplethrZip@v1.5.0').
When I run zip_choropleth() I ...
1
vote
0
answers
70
views
ggplot2 choropeth ZIPs / ZCTAs in Linux
I would like to build a choropleth map in ggplot2 using ZCTAs (ZIP code tabulation areas, a rough analogue to the geographic boundaries of ZIP codes). I've build choropleth maps in ggplot2 using the ...
2
votes
1
answer
576
views
Is it possible to add an overlay of cities to a map made using choroplethr?
I am brand spankin' new when it comes to R. Any help you can give me will be greatly appreciated.
I am using the choroplethr package to create maps by ZIP code. I want to add an overlay showing ...
3
votes
1
answer
63
views
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, ...
2
votes
0
answers
87
views
How to display value names corresponding to the states over the state name?
I'm setting up a new choropleth map for US using choroplethr and stuck in displaying value corresponding to a state over the corresponding states.
I am trying to build a choropleth maps using ...
1
vote
0
answers
134
views
Add flags and country names to choropleth
I want to add country flags as well as country names to a choropleth on which I have already added some bars.
Some standard choropleth with bars:
library(cartography)
# Some standard data on Europe
...
1
vote
1
answer
369
views
Installing "choroplethr" in Ubuntu
I am trying to install "choroplethr."
I have read the following related-looking errors:
https://askubuntu.com/questions/1057100/error-libudunits2-a-not-found-when-installing-ggraph-additional-error-...
1
vote
1
answer
89
views
Fail to extract Zip Demographics Data using get_zip_demographics() function in ChoroplethrZip package
I am trying to get the zip demographics data of the year 2015. When I tried the codes below, an error message returns.
library(devtools)
install_github('arilamstein/choroplethrZip@v1.4.0')
library(...
3
votes
1
answer
130
views
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 ...
2
votes
0
answers
82
views
Error from Google Maps API in choroplethr
I'm having an issue using the reference_map argument with the choroplethr package. I'm getting a 403 error when I set reference_map to true. The map renders fine if set to false. I've never had any ...
6
votes
1
answer
2k
views
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 ...
0
votes
1
answer
46
views
choroplethrZip returning "cannot add bindings" subtitle error - even with example code
choroplethrZip is returning a "cannot add bindings" error even when I use example code like the following:
library(choroplethrZip)
data(df_pop_zip)
zip_choropleth(df_pop_zip,
...
2
votes
1
answer
99
views
Defining custom color scale using hex codes with choroplethr
I've created a custom color palette for a project that I'd like to apply to several county-level choropleths (desired hex codes: #FFB025, #FF7913, #D72D5C, #B76BA3, #5F4B8B). I've been able to create ...
1
vote
1
answer
571
views
Problems Installing choroplethrZip: "Command failed (1)"
So I have been hitting my head against the wall for a few days now trying to understand why my machine will not load choroplethrZip. I have tried the recommended installation pathway (with devtools ...
2
votes
1
answer
335
views
Custom Bins in Choroplethr
I am using choroplethr to produce choropleths for the rates of a certain health outcome by US state (at the census tract level). After wrestling with the program I was able to get it running, but I ...
0
votes
2
answers
1k
views
Why would my residuals for a linear model in R have one less value than the data set I used to create it?
I created a linear model in R using county data from the ACS. There are 3140 entries in my data set, and they all have their corresponding fips codes. I'm trying to make a map of the residuals from my ...
0
votes
1
answer
121
views
testing choroplethr and choroplethrmaps in Hong Kong Map
I am testing choroplethr and choroplethrmaps in Hong Kong Map.
I want to show the region in Hong Kong and the vote.
following is what I have done in R.
But it does not work.
Could you help me how can ...
1
vote
1
answer
1k
views
How do I plot occurrence points (lon/lat) on a choropleth map?
I am using choroplethr to create a climate map for the Western half of the US (state and county). The map is finished and looks amazing. Now I need to plot occurrence points (lon/lat) to the map. I ...
1
vote
0
answers
157
views
loadNamespace error loading choroplethr package in R [duplicate]
I'm trying to use the county_choroplethr function of library(choropleth) package in R.
I have installed, uninstalled, and re-installed this package repeatedly, but keep getting:
Error in ...
1
vote
1
answer
1k
views
choroplethr package in R won't load
I am trying to load the choroplethr package in R and keep getting an error message that I can't troubleshoot or understand. If someone could please provide me with a workaround to fix this that would ...
1
vote
1
answer
79
views
Getting rid of unnecessary lines (axes?) in Choroplethr
Whenever I make a choropleth using the Choroplethr package, these unnecessary lines appear. I believe they're axes, but the state_choropleth function shouldn't be printing axes.
Example:
df <- data....
1
vote
1
answer
295
views
R multiple values per Polygon Choroplethr
I have the following issue and don´t know how to proceed:
I want to do a choropleth heat map, with data about German wind Power plants.
Therefore I use one shape file, mapping all German Zip codes (...
0
votes
1
answer
1k
views
Customize colors in ggplot2's geom_polygon using brewer palette
I want to replicate a map built using the exact code from this link - just from "Step 1, Building the Initial Map":
https://www.r-bloggers.com/user-question-how-to-add-a-state-border-to-a-zip-code-...
1
vote
1
answer
127
views
Choroplethr map with midpoint in R
Would someone please help me understand how to format a county level choropleth map in R with a custom color scale? I can't figure out how to get Alaska and Hawaii to update correctly.
I have tried ...
1
vote
2
answers
271
views
tract_choropleth in Choroplethr v3.6.0 for R
I'm trying to replicate the maps shown in this short example (Choroplethr v3.6.0 is now on CRAN) for California, but I'm having trouble with the tract_choropleth function for areas that are not in NY. ...
1
vote
0
answers
106
views
Trouble with get_tract_map function in R choroplthr
I've just installed the new Choroplethr v3.6.0 and am using Ari Lamstein's blog tutorial to practice, as well as learning R, so I'm still learning to read errors.
All the example code works for me, ...
0
votes
0
answers
241
views
Need help sorting data for r choropleth map
I am seeking help sorting data for r choropleth map.
I am attempting to create a choropleth map with R, using zipcode and occurrences of burglary.
However the map function is not performing properly,...