r - 串扰过滤器无法过滤具有共享数据的传单图

问题描述

我正在尝试创建一个 Rmarkdown 报告,其中会有一个下拉列表和一个地图。 The dropdown should filter the map when a value is selected,but for some reason it doesn't work.任何帮助表示赞赏:

---
title: "test"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
---
library(dplyr)
library(leaflet)
library(crosstalk)
library(flexdashboard)
library(sf)
library(sp)
dt <- data.frame(ab = c(1,1,2,2),lon = c(1,3,4),lat = c(5,4,2)) %>% 
  st_as_sf(coords = c("lon","lat"),crs = 4326) %>% 
  group_by(ab) %>% 
  summarise(do_union = F) %>% 
  st_cast("LInesTRING")
sd <- SharedData$new(dt)
filter_select("ab","AB text",sd,~ ab)
leaflet(data = sd) %>% 
  addTiles() %>% 
  addpolylines(color = "#D2691E")

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)