All Questions
86
questions
0
votes
1
answer
80
views
How to set an anchor and create polygons from shapefile
I am following up on the example here: How to make small polygons from shapefile and extract coordinates
I am trying to adapt that example to a different shapefile but I am getting errors. The new ...
1
vote
2
answers
227
views
How to make small polygons from shapefile and extract coordinates
I have a small shapefile here: https://login.filesanywhere.com/fs/v.aspx?v=8c6d62865c626fb4a2ab called bay.RDS
library(tmap)
library(leaflet)
library(mapview)
bay <- readRDS('bay.RDS')
mapview(...
1
vote
1
answer
553
views
Add a title to the Leaflet map
I have a simple question but still do not know how to find the answer to it. All I need is to add a title to the leaflet map. I do not need it to me on the map, just above it as in a usual ggplot map.
...
0
votes
0
answers
53
views
Show the aggregate value on markerClusterOptions in R
I want to do a map in R, that will show the points in clusters when you zoom in/zoom out and in the same time show a aggregate value.
Now I have this code:
m <- leaflet(acdt_1, width = "200%&...
0
votes
1
answer
173
views
RShiny display multiple leaflet maps on the same plot
I have a shiny app where the user can select to display a specific leaflet map (on 51 available), or all leaflet maps (the 51 on 11 columns and 5 rows).
To display multiple leaflet maps on the same ...
0
votes
0
answers
163
views
Add Polygon Layers to Leaflet Map (with labels and legends)
I am trying to combine 4 leaflet maps into one, where you can filter the layers using addLayerControl. Each layer has popups when you hover over the polygon with the corresponding variable (numeric) ...
1
vote
1
answer
238
views
Create a map in R and put some coordinates
I have a dataset with three variables related to coordinates: UTMX, UTMY and HUSO.
I'd like to create a map where all the points were shown.
Here an example of the dataframe:
x y huso
...
0
votes
0
answers
40
views
How to reduce incremental zooms in leaflet?
I am making maps in leaflet and cannot change the zoom increment for some reason.
I don't have the option to use
var map = L.map('map', {
zoomSnap: 0.25
});
I also don't have these functions ...
0
votes
2
answers
93
views
R Displaying Points Twice?
I have this code for an interactive map in R:
library(leaflet)
library(inlmisc)
Long = rnorm(1000, -71, 0.5)
Lat = rnorm(1000, 42.3, 0.5)
loc = rep("loc", 1000)
Name = rep("Location&...
0
votes
1
answer
2k
views
Error in UseMethod: no applicable method for 'metaData' applied to an object of class "NULL"
I'm trying to add different icon to the markers which I'm trying to show. I have different category like this
category <- data() %>%
dplyr::select(category) %>%
distinct()
and it looks ...
1
vote
0
answers
695
views
Learning How to Use Shapefiles in R
I am trying to learn more about "shapefiles" and how to plot them in R. Ideally, I would like to make a "leaflet map" (interactive or static) that looks something like this: https:...
1
vote
1
answer
3k
views
How to successfully save leaflet map in a .png image?
Out of geocoordinates, I want to draw simple plain points on a city map and save the output as a .png. I'm on Linux Ubuntu 22.04LTS. For the first part I found a pretty brief and straightforward ...
0
votes
0
answers
53
views
Tiny shiny app to monitor pollinators: leaflet map rendering locally but not rendering online
I work for a biodiversity monitoring project and I am trying to build a shiny app to better organize our fieldwork. I am basically trying to publish a map of our study area overlaid with a grid (our ...
0
votes
1
answer
128
views
R shiny renderLeaflet not rendering
I am trying to create an interactive map that displays locations only in the district chosen by the user in R shiny.
rm(list=ls())
library(readxl)
library(shiny)
library(tidyverse)
library(leaflet)
...
0
votes
0
answers
504
views
Add axis to leaflet map
How can you add an x and y axis to a leaflet map figure -- in the case of a map how to add the longitude and latitude?
For the figure below, how can axis be added please?
library(leaflet)
leaflet() %&...
-1
votes
1
answer
91
views
Trying to create a bubble map of Australia
Name Lat Long
XX -20.6544 150.9149
This is how my data looks like with over 1000 entries
The code I tried is below.
# Library
library(leaflet)
# load example data (Fiji EarthPostcode) + ...
0
votes
1
answer
625
views
Reactive Leaflet Map Not Recognizing 2nd Color Palette
I posted a similar question, but didn't make my example minimal enough, so I tried to pare it down some. So here's the problem:
I am working on a COVID19 project to visualize the spread of the virus ...
0
votes
2
answers
405
views
Chinese province coordinates in r
Does anyone knows how to access the coordinates by regions for China. The code below shows the same thing that I am looking for China. Many thanks in advance
require(maps)
states_map <- map_data(&...
5
votes
2
answers
3k
views
Leaflet not rendering in dynamically generated R markdown html knitr
I've created a R markdown report where the sections and tabsets are dynamically created.
I have an issue where the Leaflet maps are not being generated in the output, but rather a blank white space. ...
1
vote
1
answer
550
views
R Shiny --> FillOpacity Argument in AddCircles Function Ignored
I am working on a R Shiny project to visualize all of the airports in the world. The code included below is a sample of my project. Functionally, the app works as expected - The data table and map ...
0
votes
1
answer
90
views
how to plot a map only with lat, long without group in R
I am having issues with plotting a UK map. Indeed, I have issues plotting because maybe I do not have a group as a variable. This is the type of data I have.
lft_j <- structure(list(journeydate = ...
0
votes
0
answers
727
views
Adding circle markers on leaflet R on to a map already plotted
bins <- c(0,10,20,30,40,50,Inf)
pal <- colorNumeric(
palette = c('Grey', '#C9E1F9', '#BCD2E8', '#86ACC6', '#73A5C6', '#528AAE', '#2E5984', '#1E3F66', '#152B46'),
domain = ar_prov_objetivos$...
0
votes
1
answer
171
views
maps::map() returning region names instead of country names
I am trying to create a pop up for each country on a leaflet map showing the name of the country and a number. I have though come upon a similar problem in stack exchange here.
country <- c("...
0
votes
1
answer
487
views
R-Leaflet : Merged Shapefile and Excel appeared successful, but highlight label reveals that the 31 polygons are only filled w/ 4 repeating values
I am working on a map for my internship. I have the shapefile of the city of Villeneuve d'Ascq's subdivisions (referred to as "IRIS" in France) that I am mapping, and separate CSVs with various ...
0
votes
1
answer
229
views
I cannot get slider inputs to modify a map in shiny
I cannot get the map to react with the sliders. THe data was from https://www.kaggle.com/nasa/meteorite-landings/data#
when i move the sliders the map "refreshes" like it resets itself as if something ...
1
vote
1
answer
1k
views
How to retrieve point location data from a WMS leaflet layer?
I am very new to working with maps and was given a task to collect data on points from this website: https://mapadefosas.mjusticia.es/exovi_externo/CargarMapaFosas.htm#
So far I have managed to ...
0
votes
1
answer
2k
views
Get longitude and latitude from a shapefile with Leaflet in R
I've been trying to map with leaflet to add addCircles() but my shapefile doesn't seem to have the latitude lat and longitude lng parameters so I got the centroids for each city as is the code below ...
1
vote
0
answers
91
views
Map Australia - no oultine
Got code from here:
Map Australian cities - R spatial
But when I run it, it gives the map shown:
library(maps)
df <- world.cities[world.cities$country.etc == "Australia",]
library(leaflet)
## ...
12
votes
2
answers
10k
views
How can I plot individual data points in a map using R/ leaflet?
I am trying to show the individual points in a given place, like a map equivalent of dot plot. I tried with leaflet library in R, but I am only able to map the size of the marker to the continuous ...
0
votes
1
answer
471
views
Wrapping the dropdownButton in an absolutePanel in R Shiny
I'm building an interactive map with Shiny and I'm currently trying to hide my UI elements in a dropdownButton from the shinyWidgets pkg.
My problem is that so far I can either have the ...
0
votes
0
answers
470
views
Convet leaflet map to static plot [r]
How to convert leaflet map to static plot so one can save the plot as pdf.
I know about mapshot function so one can specify something like mapview::mapshot(m, file = "saveaspdf.pdf").
But suppose ...
0
votes
2
answers
2k
views
merging palette colors colorRampPalette and plotting with ggplot
I'm trying to replicate using ggplot2, an earlier question i had using leaflet. I'm trying to merge two palettes where one is used if my variable is below a certain threshold and another if above a ...
4
votes
1
answer
2k
views
merging palettes with colorRampPalette and plotting with leaflet
I'm trying to merge two colorRampPalette schemes to use in leaflet and have been following this nice example. That example works fine but I can't seem to get it to work for my work, reproducible ...
0
votes
0
answers
332
views
How to append data from a dataframe to a geojson, using R?
I want to add data from a dataframe to a geojson File. The geo json file looks like this:
"properties": {"name_2": "Freiburg im Breisgau", "name_0": "Germany", "name_1": "Baden-W\u00fcrttemberg", "...
0
votes
0
answers
3k
views
Leaflet Map to static and saving it (as pdf) [R]
How would one convert leaflet map to a static plot and then save it as pdf?,
I have createa a large leaflet map, that has over 150 MB, using mapshot does not work because it is very large. I think ...
2
votes
1
answer
828
views
leaflet:: Mapping wrong name of the countries
I have a hard time to figure out why I can't map the right country on the map. I have gone through all of my codes, I still don't understand why is not working right.
If you see any problems, please ...
1
vote
1
answer
525
views
Interactive choropleth map with leaflet inaccurately mapping data
First post, I'll try to do my best.
I'm trying to make an interactive choropleth map with leaflet in R, based off this
tutorial. It all goes great until I compare the data represented on the map with ...
0
votes
1
answer
159
views
Leaflet - europe spatial network plot and distanced island removal
I probably have very complex question related to leaflet, I am trying to plot multile countries of Europe (data downloaded from GADM), and then create a network matrix for countries, however france ...
1
vote
0
answers
541
views
leaflet minichars group argument
I would like to ask,
Is there a group arguments for function from (leaflet.minicharts)? I am using function addFlows function and I am tryng to insert it into layer control, however since it doesnt ...
0
votes
1
answer
664
views
Cluster color in leaflet Heatmap
Is there a way how to have cluster colors in leaflets addHeatmap function, let say we have some values of variables and cluster them to 8 categories (see example), is there a way how to have also 8 ...
0
votes
1
answer
229
views
Leaflet equivalent of geom_segments xend, yend arguments
I would like to ask is there a way how to set xend and yend from geom_segment arguments in leaflet`s addPolylines function?
insted of explaining I rather provide reproduceble example since it is mut ...
-4
votes
1
answer
93
views
Plotting colores areas in a leaflet maps
How would I add some heatmaps plates to a leaflet map?
Say I have some spatial econometrics model and I want to plot prediction to a leaflet map like in the picure attached[![enter image description ...
1
vote
1
answer
650
views
Interactive Chloropeth Electoral College Map in R
I am looking to replicate one of those maps where you can guesstimate the state-level results of the next presidential election and have the results of your scenario shown to you by way of changing ...
0
votes
1
answer
67
views
addPolygons is not rendering shape data on shiny server
I am trying to create a map with brazilians states, when I run this code in the UI file it works well. But I need to create a reactive map, so I wrote it on server file.
The map plots fine but the ...
3
votes
3
answers
1k
views
Plotting routes that cross the international dateline using leaflet library in R
I am interested in plotting the route from Waterloo to Taiwan using the leaflet library for R. The coordinates for the route was obtained using gcIntermediate function from geosphere. However, the ...
1
vote
1
answer
566
views
Value assigned to the wrong country using Leaflet and Maps
I'm trying to plot European Countries using Leaflet but the Values that are assigned to the countries are incorrect. The goal is to create a choropleth map of Europe where each country has a specific ...
0
votes
1
answer
145
views
setView() dictionary in R Shiny Leaflet Maps
I'm currently creating a RShiny Application that uses Leaflet Map. As a feature, I need to zoom into certain continents (based on the users choice).
Is there a setView() dictionary for each of the ...
0
votes
1
answer
937
views
Interactive map for Latitude-Longitude based Sales data
I have a data-frame with only 3 column viz latitude ,longitude and sales. These latitudes and longitudes belong to "Saudi Arabia" . I want to create interactive heatmap for sales based on Latitude and ...
2
votes
2
answers
2k
views
Interactive map with tmap does not appear in Shiny app, but does show in Rstudio viewer
The interactive map I created with tmap does show up in the RStudio Viewer, however, if I try to include it in my Shiny application it does not appear. I've used the tmap_leaflet function, ...