【发布时间】:2021-03-17 04:50:21
【问题描述】:
我正在尝试创建一个 covid19 交互式信息应用程序,但我在将 covid19.analytics 包中的 live.map() 添加到我的应用程序时遇到了很多麻烦
library(shiny)
library(shinythemes)
library(covid19.analytics)
library(plotly)
ui <- fluidPage(theme=shinytheme("cosmo"),
navbarPage( "COVID 19 APPLICATION",
tabPanel(
"Interactive COVID 19 MAP",
sidebarPanel(
),
mainPanel(
plotlyOutput("map")
)
), tabPanel(
"Countries",
sidebarPanel(
selectInput(inputId = "countries", label = "country selection", choices = c("country 1", "country 2", "country 3")),
),
mainPanel(
plotOutput( outputId = "countries")
)
),
tabPanel(
"coolness XD",
sidebarPanel( ),
mainPanel(
plotOutput( outputId = "coolness")
)
)
),
)
server <- function(input,output){
output$map <- renderPlotly({
x <- live.map()
output$map <- x
})
}
shinyApp(ui=ui,server=server)
output$map <- renderPlotly({
x <- live.map()
output$map <- x
})
}
shinyApp(ui=ui,server=server)
我仍然是 Shiny 的初学者,所以使用 renderplot/renderplotly 函数有点令人困惑。有谁知道我该如何解决这个问题?
【问题讨论】:
-
好的,感谢您的建议,我仍然收到错误消息。 mapUnexpected htmlwidget output for map 的意外绘图输出我该如何解决?
标签: r shiny maps plotly interactive