值[[3l]](cond)中出现闪亮的应用程序部署错误:尝试在不设置镜像的情况下使用cran

时间:2018-09-26 07:10:12

标签: r shiny

我现在正尝试部署此闪亮的应用程序大约2个小时。 当我在系统上运行它时,它就可以正常工作。 但是,当我尝试部署时,我在R中收到以下错误消息:

func(fname,...)中的错误:app.R没有返回shiny.appobj对象。

在Shinyapp服务器端,我得到了错误:

值[3l]中的错误:尝试在不设置镜像调用的情况下使用cran:本地... trycatch-> trycatch列表-> trycatch一个->

我尝试使用

在我的应用中手动设置镜像
##### Packages 
library(shiny)
library(dplyr)
library(sf)
library(leaflet)
library(shinydashboard)
library(rsconnect)

options(stringsAsFactors = F)

#read sf object
route_maandag_1<- st_read("route_maandag_1.shp", crs = 28992)


# lijn data moet met coordinates, geen sf object
lijn_coords<- do.call(rbind, (st_transform(route_maandag_1, crs = 4326) %>% st_geometry(.))) %>% 
  as_tibble() %>% setNames(c("lon","lat"))

# icon kleur instellen
icons <- awesomeIcons(
  icon = 'ios-close',
  iconColor = 'black',
  library = 'ion',
  markerColor = route_maandag_1$color
)


# Define UI for application that draws a histogram
ui <- dashboardPage(
  dashboardHeader(
    title = "route 1: monday"
  ),

  dashboardSidebar(disable = TRUE),

  dashboardBody(
    fluidRow(
      column(width = 12,
             box(width = NULL, solidHeader = TRUE,
                 leafletOutput("map", width = "100%", height = "90vh"))))
  )
)



# Define server logic required to draw a histogram
server <- function(input, output) {

  # plot the data in leaflet
  output$map <- renderLeaflet({
    leaflet(data = st_transform(route_maandag_1, crs = 4326)) %>%
      addProviderTiles("Stamen.Terrain") %>%
      setView(lng = 4.314960, lat = 51.916024, zoom = 10) %>%
      addAwesomeMarkers(icon=icons,
                        popup = paste("<i>", route_maandag_1$Stop, "</i></br>",
                                      "<i>", paste(route_maandag_1$Straat, paste(route_maandag_1$Huisnummer,route_maandag_1$Huisletter), sep = " : "), "</i></br>")) %>%
      addPolylines(data = lijn_coords, lng = ~lon, lat = ~lat,
                   opacity = 1,
                   color = "black",
                   weight = 5)
  })

}



# Run the application 
shinyApp(ui = ui, server = server)

但是,这没有用 任何帮助将不胜感激!我很茫然!

try-catch{}

0 个答案:

没有答案