Skip to main content

All Questions

Tagged with
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

15 30 50 per page