Skip to main content

All Questions

Tagged with
0 votes
1 answer
596 views

Multiple layers on TMAP

I have a dataframe looking like this: dataframe Id is the zip code and the columns go from 2015 to 2019. Link to download the database (with the .shp file needed to execute this program) library(...
Vincent Changeon's user avatar
0 votes
1 answer
378 views

Update to "reverse order in R leaflet continuous legend"?

I have exactly the same question as this one from 5 years ago. I want to invert the scale of a continuous color scale in a leaflet choropleth created from R. I'm hoping that there is a better answer ...
Dave Braze's user avatar
1 vote
1 answer
297 views

Plot choropleth from data.frame containing coordinates/zip code and id

I'm analysing real-estate sales for some N. American cities and am using k-means clustering on the data. I have seven clusters and for each observation in the cluster I have the latitude, longitude, ...
Gautam's user avatar
  • 2,713
1 vote
0 answers
129 views

How to plot choropleth map using zip codes?

I want to plot a dataset into a chloropleth map using the zip codes. The score represents the density of the desired chloropleth map regions ZIP.CODE score 1 10000 5.400 2 10001 88....
Kunal Ostwal's user avatar
2 votes
0 answers
498 views

Time series chloropleth in R Shiny / Leaflet

How do you animate a choropleth in RShiny over time using leaflet? I would like to animate the color of choropleths over time in Shiny according to their numeric value. Below is what I have tried, but ...
seabass20's user avatar
  • 277
0 votes
2 answers
271 views

Deal with missing regions which provoke NAs in choropleth map

I have the dataframe below for which I want to create a chorpleth map. I downloaded the germany shapefile from here and then I use this code to create the map. As you can see the map is created but ...
firmo23's user avatar
  • 8,306
0 votes
0 answers
107 views

Can I create an embed code for an interactive choropleth map made using the leaflet package in R?

I'm new to R. I've just made a basic interactive choropleth map using the leaflet package in R: leaflet() %>% addProviderTiles("CartoDB.Positron") %>% setView(-2, 55, zoom = 5) %&...
TL_13's user avatar
  • 1
3 votes
1 answer
799 views

How to Properly Store ShapeFiles when Deploying R Shiny App

I am working on an R Shiny project to visualize the spread of COVID19 around the world. When I run the app locally, it works just fine, but when I try to deploy the app, it runs into issues which I ...
user2813606's user avatar
1 vote
0 answers
884 views

How to change the transparency of shapefile in tmap_leaflet

I am using tmap_leaflet function to make a map and I like the result, however, I would like to slightly change the transparency of the shapefile such that I am able to see a bit of the tiles google ...
Ani's user avatar
  • 338
2 votes
1 answer
2k views

How to create a leaflet choropleth map of US counties

With the code below I get my dataframe with US county data library(raster) library(leaflet) library(tidyverse) # Get USA polygon data USA <- getData("GADM", country = "usa", level = 2) ### Get ...
firmo23's user avatar
  • 8,306
2 votes
1 answer
5k views

Shiny reactive value with radiobutton

I am creating a Shiny app meant to display a choropleth map. I would like to change reactivly the values to show on my map with radiobuttons. It worked fine with normal button, but i am struggling ...
Oscar Jnn's user avatar
  • 154
0 votes
1 answer
840 views

Is it possible to create a choropleth leaflet map without having the state coordinates?

I was wondering if it is possible to create a chorolpleth map with leaflet if you do not have lat and long data but either the full state name or the short name like 'AL' from Alabama etc. I use a ...
firmo23's user avatar
  • 8,306
0 votes
1 answer
215 views

Why is my choropleth gradient in Leaflet inaccurate?

I am trying to plot a choropleth using shape files and leaflet. I merged a population column to the shape file data frame, and used that column to base the gradient on. The merge was successful in ...
Benji Kenobi's user avatar
2 votes
2 answers
509 views

Only the first polygon is showing up in Leaflet 2.0.1 choropleth plot

My leaflet choropleth plot in my Shiny App is only showing the first polygon after the recent package update to Leaflet 2.0.1. I had adapted the code from the Leaflet for R webpage and it used to ...
ssum-berkeley's user avatar
1 vote
1 answer
311 views

Matching up data with a list of SpatialPolygonsDataFrame objects to run a choropleth map in leaflet

I'm teaching myself how to use mapping tools in R, and in this case I'm looking to set up a choropleth map of various countries at the respective regional levels based on the results from the mydata ...
Phil's user avatar
  • 7,992
1 vote
1 answer
5k views

How to create a choropleth on a leaflet Map R

Problem I have loaded in the shapefile of the UK, no issues. Lets call this FILE1. I also have a data frame file with 2 columns: Longitude, Latitude. lets call this FILE2. I am trying to plot the ...
mojo3340's user avatar
  • 549
2 votes
1 answer
1k views

How do I integrate multiple choropleth maps made with Leaflet in Shiny?

I have created three separate choropleth maps in Leaflet, all are across Europe with the same countries being used. Each choropleth map shows a different type of ratio and has two layers for 1999 and ...
Emily Robinson's user avatar
2 votes
1 answer
921 views

R shiny chorpleth map

I am new in R. now I am creating shiny app. R can read my dataset. with the comand myData <- read.csv("myData.csv"). however shinyServer file cannot read my data. and list no observation. Could ...
Fzd's user avatar
  • 23
1 vote
1 answer
941 views

How can I apply the same colorscale to 2 maps in plotly using R

I have a dataframe from which I want to produce two US state maps, ideally in plotly, but which have the same colorscale. e.g a value of 1.6 would have same color on both maps library(plotly) ...
pssguy's user avatar
  • 3,505
10 votes
3 answers
8k views

reverse colors in colorNumeric()

I am trying to reverse the colors of a choropleth map. I am using the leaflet package and the colorNumeric() function, here is the code that generates the palette function: pal <- colorNumeric(...
Pierre Dudek's user avatar
1 vote
0 answers
510 views

Leaflet choropleth maps in shiny - unable to use addPolygons function properly

I am new to writing shiny apps and new to using the leaflet package. I am trying to create a shiny app which will get user inputs and plot a choropleth map based on the aggregated values of the ...
krish's user avatar
  • 1,418
0 votes
0 answers
3k views

R Leaflet choroplete map with timeslider?

I got time related data (7 years) displayed in a choropleth map, using R and Leaflet-for-R-package. Therefore use a kmz-file for geometry and csv data for attributes. So far I tried it with data for ...
Philippo Storino's user avatar
2 votes
1 answer
2k views

R Shiny leaflet addPolygons (colors are not showing)

I hope you can help me. I have created a choropleth Map with Leaflet. I merged my (dataframe with countries and a random score) and a Shapefile with the Polygon data. So far it is working, however if ...
Josef's user avatar
  • 21
4 votes
1 answer
1k views

TopoJSON choropleth in R/Leaflet?

Is it possible to style a TopoJSON file from its features for a choropleth using R/leaflet? Tried a few things, and I'm not sure if this is impossible with the leaflet package or if I just don't have ...
Nathan Thompson's user avatar
4 votes
3 answers
2k views

How to plot a specific column from a SpatialPolygonDataframe with leafletR?

I would like to create a choropleth map using leafletR::leaflet. My data comes in a SpatialPolygonsDataFrame, and I would like to choose a specific column to be plotted. With sp::spplot, this is easy-...
chamaoskurumi's user avatar