是否有人知道是否可以从单张选定项目创建链接以打开专用仪表板?
请在下面找到可重现的示例
当用户点击“转到专用仪表板”时,我希望我的应用程序打开一个带有专用仪表板的新窗口(显示与所选国家/地区相关的图表...)
library(shiny)
library(leaflet)
# download zip file
download.file(url = "http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip", destfile = "TM_WORLD_BORDERS-0.3.zip")
# unzip
unzip( zipfile = "TM_WORLD_BORDERS-0.3.zip" )
# transfrom to sf and select two countries
world.borders <-read_sf( dsn = getwd(), layer = "TM_WORLD_BORDERS-0.3" )
world.borders <- world.borders[world.borders$NAME %in% c("Australia","United States"),]
ui <- fluidPage(
leafletOutput("mymap")
)
server <- function(input, output, session) {
output$mymap <- renderLeaflet({
leaflet(options = leafletOptions(maxZoom = 18)) %>% addTiles() %>%
addPolygons( data = world.borders, fill = "#D24618", color = "#D24618",
popup = paste0(
"<b>Country: </b>"
, world.borders$NAME
, "<br>"
, "<a href='"
, "' target='_blank'>"
, "Go to dedicated dashboard</a>")
, label = ~NAME)
})
}
shinyApp(ui, server)
非常感谢任何tipps,谢谢你。