我的应用在本地运行,但是在发布时不起作用: “ 错误:发生了错误。请检查您的日志或与应用作者联系以进行澄清。” 这是创建闪亮应用程序的首次体验。老实说,我对该命令的理解还不完整。 如果有时间,请帮助我。 我在下面指出了我的应用程序和应用程序的完整版本(本地)。
server.R
library(shiny)
library(leaflet)
library(ggmap)
library(dplyr)
shinyServer(function(input, output) {
values = reactiveValues(geocodes = rbind(c(139.6917, 35.68949), c(140.1233, 35.60506)))
observeEvent(input$submit, {
geo1 = geocode(input$search_word1)
geo2 = geocode(input$search_word2)
if(is.na(geo1[1,1])){
geo1[1,] = values$geocodes[1,]
}
if(is.na(geo2[1,1])){
geo2[1,] = values$geocodes[2,]
}
values$geocodes = rbind(geo1, geo2)
})
output$plot = renderLeaflet({
NIESsite_SISNOxPMSO2WDWS <-
read.csv("SIS_PMSO2NOxWDWS.csv") %>%
rename(roman = 6) %>%
rename(pref_code = 2)
df2 <-
NIESsite_SISNOxPMSO2WDWS %>%
select(2,6,7,8) %>%
rename(site_name= 2)
knitr::kable(df2)
map_data = leaflet(df2) %>%
addTiles("https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png", group = "GSI") %>%
setView(lng=133,lat=34.8,zoom=8) %>%
addMarkers(lng=~lon,lat=~lat,label=~site_name, labelOptions = labelOptions(style = list("font-size" = "16px")))
return(map_data)
})
})
ui.R
library(shiny)
library(leaflet)
library(ggmap)
shinyUI(fluidPage(
titlePanel("AQ Monitoring site around Seto Inland Sea (SO2,PM2.5,NOx,WD,WS data available)"),
sidebarLayout(
sidebarPanel(
h4("There are no WD and WS data (Kagawa : 2017)")
),
mainPanel(
leafletOutput("plot", width="100%", height = "900px")
)
)
))