Skip to main content

All Questions

Tagged with
0 votes
1 answer
64 views

can we popop the name of the place when we use addGeoJson in R

I'm using addgeoJson function for the india map. I have data that I got it from here https://gadm.org/download_country.html for example I'm using this data This is a json file and I read that json ...
Siddhant Singh's user avatar
3 votes
1 answer
2k views

Map background colour/transparency within R leaflet

I'm using a geojson file to produce a map with leaflet on R. I would like to change the background colour to the white, or make the background transparent if it is possible (this is actually really ...
fillo's user avatar
  • 405
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
3 votes
1 answer
706 views

Converting geojson into sf for a clotopleth map

I have recently been wrapping my head around the leaflet package and have gotten around the basics of adding markers, reading/plotting shapefiles from local source and displaying the final outputs in ...
k3r0's user avatar
  • 377
0 votes
1 answer
44 views

Cannot visualize geojson in R using leaflet package

I would like to visualize municipalities in R using Leaflet. This is my code: library(leaflet) library(jsonlite) geojson <- readLines("https://cartomap.github.io/nl/wgs84/gemeente_2020.geojson", ...
Willy's user avatar
  • 497
0 votes
1 answer
400 views

Cannot load valid json/us-states.geojson for Chropleths map using Leaflet and R. Loving R and Leaflet but stuck

Learning R for mapping with Leaflet. Seems like a great guide here, but I’m stuck with a Chropleths map. https://rstudio.github.io/leaflet/choropleths.html Download the USA geoson file. It’s in my ...
Edward Potter's user avatar
0 votes
1 answer
2k views

Leaflet (R) addPopups: coordinates/properties

I'm fairly new to handling spatial data and leaflet in general. I'm having difficulty creating a popup for my map. Basically what I want in the popup is the coordinates of my polygon and one of the ...
fletchr's user avatar
  • 636
6 votes
3 answers
2k views

Subsetting geojson data with R

I have a geojson file of state boundaries that I obtained from here. In particular I'm using the 20m US States Data I'm trying to subset the data so that I can use leaflet to map only certain states. ...
Kactus's user avatar
  • 122
0 votes
1 answer
663 views

Unable to use GeoJSON using leaflet package in R

I am trying to plot the GeoJSON in R using Leaflet package. Below is the code and the error. library(geojsonio) library(leaflet) library(data.table) library(plyr) library(rgdal) ...
SNT's user avatar
  • 1,353
1 vote
0 answers
131 views

Map (with geojson) instead of Leaflet map

I am doing a poster for class. Everything was ok, I created a descent map for showing some data in New York, using Leaflet. jpal <- colorRampPalette(c("#03B9FF", "#801515")) # qpal <- ...
Anakin Skywalker's user avatar
1 vote
1 answer
1k views

How to download NY state all County data in R for leaflet map

# From http://eric.clst.org/Stuff/USGeoJSON and # https://en.wikipedia.org/wiki/List_of_United_States_counties_and_county_equivalents nycounties <- geojsonio::geojson_read("json/nycounties.geojson",...
Bin's user avatar
  • 547
4 votes
1 answer
2k views

How to download geojson data and read it to R

# From http://leafletjs.com/examples/choropleth/us-states.js states <- geojsonio::geojson_read("json/us-states.geojson", what = "sp") bins <- c(0, 10, 20, 50, 100, 200, 500, 1000, Inf) pal <-...
Bin's user avatar
  • 547
5 votes
2 answers
878 views

Use strings of geoJSON with leaflet

I have a dataframe where my first columns is geojson strings and the second is a metric for that location. The string in the first column renders properly if pasted into https://geojson.io/ I want to ...
user1923975's user avatar
  • 1,389
5 votes
1 answer
744 views

Leaflet polygons losing colour when R Shiny app opened in web browser

I'm building a map using leaflet in R, to be deployed as a Shiny app. The Shiny app is working fine within RStudio, but when I open it in a web browser the polygons lose their colour. Everything else ...
JaydenM-C's user avatar
  • 288
1 vote
1 answer
430 views

reactive selection of json property in R for leaflet without shiny

With the following minimal example in R (Markdown) it's possible to select between two different topojson properties and draw reactively a different leaflet choropleth map according to the selection ...
Marcel Stadelmann's user avatar
2 votes
2 answers
4k views

R geojson feature display with leaflet

I have a GeoJSON map that is rendering fine with leaflet and open street map tile from Rstudio IDE locally, however the map doesn't display the features and properties (embeded in the jeojson file) ...
Antex's user avatar
  • 1,414
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
4 votes
1 answer
2k views

Trouble reading in geojson/json file into R for plotting on map

I'm trying to read in a json file which contains polylines into R for plotting in leaflet or ggmap. The file is in the geojson format. The file can be found at: http://datasets.antwerpen.be/v4/gis/...
Jeroen Boeye's user avatar
7 votes
4 answers
7k views

Zooming into State to view ZipCode using R Leaflet

I am using R leaftlet package to create a interactive choropleth of the U.S. There are several tutorials online and I am able to create interactive state level map with popups and zooming. Also I was ...
user2961712's user avatar
5 votes
1 answer
6k views

How do I use the addGeoJSON() feature in R for Leaflet?

Could someone please explain how the addGeoJSON() feature works in R, I cannot make sense of the documentation. ?addGeoJSON => (map, geojson, layerId = NULL) What is geojson and layerId? I was ...
Dazzle's user avatar
  • 3,022
1 vote
0 answers
255 views

Reading geojson file in R

I have converted .shp file into geojson file using rgdal, httr, leafletR packages file <- "province" # shp file name arg_file <- readOGR(dsn = ".", "province") # destination require . to load ...
analytics3345's user avatar
1 vote
1 answer
220 views

R rMaps geoJson function not plotting

I have a JSON route coming from ESRI service. I try to plot the route using geoJson using rMaps. The only output I get is the map but not the plot from the polygon. This is the code: require(rMaps)...
aruizga's user avatar
  • 644
1 vote
1 answer
2k views

leaflet-shiny with country geojson layer

I'm using R + Shiny to display a leaflet map. I would like to add several countries (in the form of layers) to this map and I have looked around and found this websites which offer the GEOJSON data: ...
Carlos's user avatar
  • 391
4 votes
3 answers
1k views

I am trying to make an interactive map using leafletR package according to a ZevRoss blog. But there is an error in the code

The ZevRoss blog is as follow: http://zevross.com/blog/2014/04/11/using-r-to-quickly-create-an-interactive-online-map-using-the-leafletr-package/ The code with error is: # ----- Write data to ...
wjy_202's user avatar
  • 41
1 vote
0 answers
215 views

Plot polygons with different colors using rMaps

I'm trying to plot polygons on a map using rMaps and fill the polygons with different colors. I tried unsuccessfully change the 'color' and 'fillcolor' attributes: require(yaml) library(rCharts) ...
Gilad's user avatar
  • 21
0 votes
1 answer
2k views

add multiple polygons to rCharts leaflet map

When I try to add more than one polygon to a leaflet map with rCharts using the map$geoJson() function, only the last polygon appears on the map. The other ones are not displayed. Any idea on what I ...
maRtin's user avatar
  • 6,466