r-leaflet

Leaflet maps not working in R Studio after R 4.0.0 upgrade

核能气质少年 提交于 2020-05-28 07:17:01
问题 I updated my computer the other day (R, R Tools, and RStudio), and leaflet stopped working. When I run this example in the RGUI it's very slow, but eventually it opens a web page in a browser. When I run it in R Studio it's very slow, eventually the command finishes but nothing appears in the "view" tab, and R Studio keeps using more and more memory until I force kill it. library(leaflet) leaflet() %>% addTiles() %>% addMarkers(lng=174.768, lat=-36.852, popup="R") I've tried a few things with

Leaflet maps not working in R Studio after R 4.0.0 upgrade

帅比萌擦擦* 提交于 2020-05-28 07:14:48
问题 I updated my computer the other day (R, R Tools, and RStudio), and leaflet stopped working. When I run this example in the RGUI it's very slow, but eventually it opens a web page in a browser. When I run it in R Studio it's very slow, eventually the command finishes but nothing appears in the "view" tab, and R Studio keeps using more and more memory until I force kill it. library(leaflet) leaflet() %>% addTiles() %>% addMarkers(lng=174.768, lat=-36.852, popup="R") I've tried a few things with

R - leaflet - highcharter tooltip

泄露秘密 提交于 2020-05-11 14:45:53
问题 I want to include a highcharter plot in my leaflet popup. With help from this post Iam able to include a sparkline plot. However, due to my lack of html skills I dont know how to modify the code to work with highcharter . This answer on SO (example from answer) is exactly what I want. I just dont know how to implement in in R . library(leaflet) library(tidyverse) library(htmlwidgets) library(htmltools) library(sparkline) library(highcharter) # Step 1 convert htmlwidget to character

Adding an interactive filter to a layered leaflet() map in R

假如想象 提交于 2020-04-17 03:44:51
问题 I have created a map that has different layers for different variables, but would like to also have a selector box that allows you to select which year you view , essentially filtering the data for that particular year. The code below makes the map based on all years data. I'd like almost the same map, but with the ability to change what year you are viewing data for (i.e. 1990, 1991, 1992, or 1993) # get shapefiles (download shapefiles: http://www2.census.gov/geo/tiger/GENZ2014/shp/cb_2014

Adding an interactive filter to a layered leaflet() map in R

时间秒杀一切 提交于 2020-04-17 03:42:06
问题 I have created a map that has different layers for different variables, but would like to also have a selector box that allows you to select which year you view , essentially filtering the data for that particular year. The code below makes the map based on all years data. I'd like almost the same map, but with the ability to change what year you are viewing data for (i.e. 1990, 1991, 1992, or 1993) # get shapefiles (download shapefiles: http://www2.census.gov/geo/tiger/GENZ2014/shp/cb_2014

R leaflet is drawing base layers on top of overlay layers

别等时光非礼了梦想. 提交于 2019-12-31 05:23:09
问题 I'm running into a problem with leaflet for R: When I change the base layer (polygons), the overlay layer gets pushed behind the base layer. From my reading of the leafletR help files, the overlay layers should always have a higher z-index than the base layers, and should stay on top. Example is here: http://rpubs.com/bvila/overdraw require(acs) require(tigris) require(leaflet) require(tidyverse) leaflet(data = counties(state = "UT")) %>% addPolygons(color = "red", fillColor = "orange", group

Draw a map of a specific country with leaflet

心不动则不痛 提交于 2019-12-30 03:32:06
问题 I would like to use the package leaflet with R to draw a map of a specific countries such as Italy, Spain, etc. I checked the basic examples with the function setView() and I tried to give a vector of two values for the arg of latitude and longitutde : m <- leaflet() %>% addTiles() %>% # Add default OpenStreetMap map tiles setView(lng=c(46.00,48.00), lat=c(2.00,6.00), zoom = 4) m # Print the map (map is not centered on a country, it's just a test) But I will never be able to have a specific

Change Leaflet Map Dynamically based on Multiple Reactive expressions

风流意气都作罢 提交于 2019-12-25 01:34:59
问题 In the example Data Frame DF , I have the following columns. gender <- c("Male", "Female","Female", "Male") Location <- c("AB", "BC", "CD", "DE") hasTV <- c("Yes","Yes","No","No") Latitude <- c(49.82380908513249,59.478568831926395,59.478568831926395,49.82380908513249) Longitude <- c(-10.8544921875,-10.8544921875,2.021484375,2.021484375) DF <- data.frame(gender,Location,hasTV,Latitude,Longitude) Under UI, i've used radiobuttons to select options from hasTV, checkboxGroupInput to select Gender

R shiny checkboxGroup to plot data on map

荒凉一梦 提交于 2019-12-25 00:24:35
问题 I am very new to shiny, and I have a question. I have a simple dataset with observations (Number_Total) of species (Species), in a certain location (X,Y). I would like to generate a map, that enables you to select the species in a dropdown menu. Shiny then shows you were the species occurs on the map. I got pretty far (for my experience), but selecting species in the menu does not do anything... ui <- (fluidPage(titlePanel("Species Checker"), sidebarLayout( sidebarPanel( selectizeInput(

Shiny R dynamic heatmap with ggplot. Scale and speed issues

落花浮王杯 提交于 2019-12-24 20:08:56
问题 I am attempting to use some public information to produce a heat-map of Canada for some labor statistics. Using the spacial files from the census, and data from Statistics Canada (these are large zip files that are not necessary to dig into). Below is a working example that illustrates both the problems I am having with little relative change between regions( though there may be a big absolute change between periods, and the slow draw time.To get this to work, you need to download the .zip