Ошибка развертывания приложений на сервере shinyapps.io - PullRequest
1 голос
/ 24 марта 2020

Когда я только что написал приложение, которое отлично работает локально, но когда я пытался развернуть его в Интернете, я получаю эту ошибку:

сообщение об ошибке:

Подготовка к развертыванию application ... DONE Загрузка пакета для приложения: 1969928 ... Ошибка в curl :: curl_fetch_memory (url, handle = handle): истекло время ожидания: [api.shinyapps.io] Тайм-аут операции через 10000 миллисекунд с 0 из 0 Получено байт. Вызовы: ... tryCatch -> tryCatchList -> tryCatchOne -> Время остановлено в: 0 0 10

моя блестящая версия: 1.4.0.2; ОС: Windows10; IDE: RStudio;

Большое спасибо за помощь!

Мой полный код:

library(shiny)
library(DT)
library(readr)

######################### read data #########################
pump1 <- read_csv("data/1.csv", col_names=TRUE)
pump2 <- read_csv("data/2.csv", col_names=TRUE)
pump3 <- read_csv("data/3.csv", col_names=TRUE)
pump4 <- read_csv("data/4.csv", col_names=TRUE)
pump5 <- read_csv("data/5.csv", col_names=TRUE)
pump6 <- read_csv("data/6.csv", col_names=TRUE)
# pump7 does not have instantFlow feature
pump7 <- read_csv("data/7.csv", col_names=TRUE)

colnames(pump1) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump2) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump3) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump4) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump5) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump6) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "instantFlow", "openDegree", "vacuumDegree")
colnames(pump7) <- c("Date", "backT", "frontT", "moduleT", "I", "V", "openDegree", "vacuumDegree")

######################### ui #########################

ui <- fluidPage(
  h1("Data Presentation", align = "center"),
  br(),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "data", label = "choose data to display", choices = c(
        "pump 1", "pump 2", "pump 3", "pump 4", "pump 5", "pump 6", "pump 7"
      )),
      # contents: Data summary
      h3(textOutput(outputId = "caption")),
      verbatimTextOutput(outputId = "summary"),
      width = 3
    ),
    mainPanel(
      DT::dataTableOutput(outputId = "DToutput", height = 0.5)
    )
  ),
  hr(),
  h1("roc-auc curve", align = "center"),
  br(),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "chooseImg", label = "choose a pump to estimate others",
                  choices = c("pump1 vs all", "pump2 vs all", "pump3 vs all", "pump4 vs all", "pump5 vs all", "pump6 vs all", "pump7 vs all"))
                ),
    mainPanel(
      imageOutput(outputId = "image")
    )
  ),
)
######################### server #########################

server <- function(input, output) {
  ############################# 1st part #############################
  # Now, data is a reactive expression,
  # when the select box changes, data changes to the spefic pump data accordingly
  data <- reactive({
    switch(input$data, 
           "pump 1" = pump1,
           "pump 2" = pump2,
           "pump 3" = pump3, 
           "pump 4" = pump4,
           "pump 5" = pump5, 
           "pump 6" = pump6, 
           "pump 7" = pump7)
    })

  output$caption <- renderText("Data summary")

  output$summary <- renderPrint({
    summary(data())
  })

  output$DToutput <- DT::renderDataTable(data())

  ############################# 2nd part #############################
  # toDisplay <- switch(
  #   input$chooseImg,
  #   "pump1 vs all" = list(src = "images/roc_1vsall.png"),
  #   "pump2 vs all" = list(src = "images/roc_2vsall.png"),
  #   "pump3 vs all" = list(src = "images/roc_3vsall.png"),
  #   "pump4 vs all" = list(src = "images/roc_4vsall.png"),
  #   "pump5 vs all" = list(src = "images/roc_5vsall.png"),
  #   "pump6 vs all" = list(src = "images/roc_6vsall.png"),
  #   "pump7 vs all" = list(src = "images/roc_7vsall.png")
  # )

  output$image <- renderImage({
    if (is.null(input$chooseImg))
      return(NULL)

    if (input$chooseImg == "pump1 vs all")
      return(list(src = "images/roc_1vsall.png"))

    else if (input$chooseImg == "pump2 vs all")
      return(list(src = "images/roc_2vsall.png"))

    else if (input$chooseImg == "pump3 vs all")
      return(list(src = "images/roc_3vsall.png"))

    else if (input$chooseImg == "pump4 vs all")
      return(list(src = "images/roc_4vsall.png"))

    else if (input$chooseImg == "pump5 vs all")
      return(list(src = "images/roc_5vsall.png"))

    else if (input$chooseImg == "pump6 vs all")
      return(list(src = "images/roc_6vsall.png"))

    else if (input$chooseImg == "pump7 vs all")
      return(list(src = "images/roc_7vsall.png"))
  }, deleteFile = FALSE)

}

shinyApp(ui, server)
...