r-leaflet

R Leaflet Label Set direction

核能气质少年 提交于 2019-12-24 19:52:58
问题 Please have a look at the below example code, I would like to use the label direction (MyDirection), which is stored in df to have different label directions within my map. I can set every label to a specific direction like direction = "top" , but somehow its not working if I specify direction = ~MyDirection . Any Idea/solution would be much appreciated. Thanks in advance. library(leaflet) df <- read.csv(textConnection(" Name,Lat,Long,MyDirection ANN,51.19,4.46277778,right BAB,43.26306,-2

Applying leaflet map bounds to filter data, within Shiny

无人久伴 提交于 2019-12-24 08:58:39
问题 The code below is meant to reproduce that which is found in this example with the exception of adding an additional parameter for "speed". However, my map-datatable link has broken - Can anyone help me spot the bug ? The original code updates the table based on the bounds of the map, while in my code changing the map zoom has no effect on my table. I'm also not able to get the "speed" filter to work on the table and map, which is a functionality I am looking for. Any pointers would be

Dynamic Color Fill For Polygon Using Leaflet In Shiny Not Working

自作多情 提交于 2019-12-20 07:21:48
问题 My goal is to create a map that highlights states based on a dropdown menu. I have produced a map that works as intended for one of the metrics in the data set, but when I try and recreate the map in a shiny app the states are all grey rather than varying shades of green. Here is my code: library(shiny) library(tidyverse) library(leaflet) library(dplyr) library(tigris) library(DT) library(rgdal) library(RColorBrewer) #create the UI ui <- fluidPage( #create title titlePanel("Interactions by

R - Leaflet Limitations - How many markers does a leaflet map support?

故事扮演 提交于 2019-12-20 06:18:02
问题 Data I have a dataframe which contains 35,000 lat/lon locations. The locations have been plotted onto an interactive leaflet map. The Situation I would like to publish the map online via a markdown document. The Problem When I export the map as an html page or in markdown the map is: Laggy Hard to navigate Webpage Loads slowly Questions What is the maximum number of points you plot on a leaflet map without compromising the ability to navigate the map? Would publishing the map as a shiny

How to add labels on top of polygons in leaflet

Deadly 提交于 2019-12-19 08:59:21
问题 I am working with the leaflet R package. I have a zoning system made of polygons and I'd like to lay their IDs on top of them. Below is an illustration (with another software) of my objective. Thanks for your suggestions! 回答1: Since there is no reproducible data, I decided to use one of my previous posts related to leaflet. There are two things you want to take away from this post: 1) you need to create a data frame containing center points of target regions, 2) you need to use

how to use colorNumeric within addCircles in leaflet

北慕城南 提交于 2019-12-13 20:13:42
问题 I have a leaflet map in which I have used addCircles, which are sized based on the population size of my data locations. I now want to color those circles based on the income of the population using colorNumeric. How do I use the population variable to determine my circle radii and simultaneously use the income variable to determine my color? ```{r} library(leaflet) leaflet()%>% addTiles() %>% addCircles(data = censusdata3, lng = ~Lon, lat = ~Lat, weight = 1, radius = ~households_estimate

Return a rendered leaflet map from leafletProxy()

為{幸葍}努か 提交于 2019-12-13 02:27:34
问题 Is it possible to retrieve a leaflet map in Shiny after it's already been rendered? Here is an example in code that shows how a map generated by leaflet() is different from one that is returned from leafletProxy() even though they would appear the exact same when rendered. Is there a function maybe different from leafletProxy() to get the actual htmlwidget object? library(shiny) library(leaflet) m1 <- leaflet() %>% addTiles() shinyApp( ui = fluidPage( textOutput("test"), br(), leafletOutput(

Leaflet separate lines

﹥>﹥吖頭↗ 提交于 2019-12-12 06:16:53
问题 I am trying to plot lines using leaflet, however I am encountering some difficulties in separating the segment. I have an object that looks like this > head(trips, n=15) time.start time.end long.start long.end lat.start lat.end distance time.diff speed color 1 1476450598 1476450713 9.03913 9.03924 45.61335 45.61362 31.25292 115 0.9783524 green 2 1476450713 1476450727 9.03924 9.03995 45.61362 45.61365 55.38651 14 14.2422459 green 3 1476450727 1476450751 9.03995 9.04005 45.61365 45.61340 28

Intersecting Circles on a Map based on on different categorical variables

怎甘沉沦 提交于 2019-12-11 14:55:27
问题 I am trying to build an app where I show circles that represent the radiuses of workers from certain coordinates. However, I would like to also include categorical variables like the customer that the worker can do and the day of the week in which the work is to be done (So Mon through Fri). I want to show only the circles that have certain combinations on the map when I select them. For instance, if I select Mon and Thr and I also select customer X and Z, I will only see the circles of Mon

Filtering leaflet map data in shiny

China☆狼群 提交于 2019-12-11 04:05:10
问题 I'm having trouble setting up this shiny with a leaflet map. My original post had two questions and it was suggested I should start a new post to address my second issue: how do I get the map to show my updated data after I have filtered by speed ; my table gets updated whether I change "speed" or the map bounds, but the leaflet map does not update points based on the speed filter input. REPRODUCIBLE CODE library(shiny) library(magrittr) library(leaflet) library(DT) ships <- read.csv( "https: