如何使用闪亮的tmap

时间:2018-06-13 16:01:16

标签: r shiny leaflet tmap

我在使用tmap加载地图时遇到问题。当我运行闪亮的代码时,输​​入部分显示,但不显示输出。代码不会崩溃,但它也永远不会运行。我的目标是能够使用tmapleaflet创建一个交互式地图,该地图能够在闪亮之外运行。

library(tmap) # and maybe also: library(tmaptools)
library(shiny)

ui <- fluidPage(
  titlePanel("Europe"),

  mainPanel(
    plotOutput(outputId = "europe")))

server <- function(input, output) {

  output$europe <- renderPlot({
    qtm(Europe)})}

shinyApp(ui, server)

1 个答案:

答案 0 :(得分:1)

一切都适合我:

library(shiny)
library(tmap)
data("Europe")

ui <- fluidPage(
  titlePanel("Europe"),
  mainPanel(
    plotOutput(outputId = "europe")))

server <- function(input, output) {

  output$europe <- renderPlot({
    qtm(Europe)
  })
}

shinyApp(ui, server)

enter image description here