如何解决无法打开连接且HTTP状态为“ 403 Forbidden”的问题,并发布了闪亮的应用

时间:2019-04-02 22:40:45

标签: r shiny publish

我创建了一个使用在线存储的数据的闪亮应用程序,该应用程序在我的本地计算机上可以正常运行,但发布时没有出现任何错误,但该应用程序在显示时不显示

open.connection(file,“ rt”)中的警告:   无法打开URL'https://srv-file1.gofile.io/download/XxeVgl/1ed58a40507be582e8d182b440247623/try.csv':HTTP状态为'403 Forbidden' 值错误[3L]:   无法打开与“ https://srv-file1.gofile.io/download/XxeVgl/1ed58a40507be582e8d182b440247623/try.csv”的连接 调用:本地... tryCatch-> tryCatchList-> tryCatchOne-> 执行停止

并且不起作用

我提供了以下应用程序的代码

g<-read.csv(url('https://srv-file1.gofile.io/download/XxeVgl/1ed58a40507be582e8d182b440247623/try.csv'), stringsAsFactors =  F)
ui <- fluidPage(

  # Sidebar layout with a input and output definitions 
  sidebarLayout(

    # Inputs
    sidebarPanel(
      #criteria 5
      selectInput(inputId = "e", 
                  label = "Drug",
                  choices = c('Other',g[,2]),selected = 'Other', selectize=F),

      # Select variable for crtieria 1
      selectInput(inputId = "a", 
                  label = "Delay from initial drug component intake to onset of reaction (index day)",
                  choices = c("From 5 to 28 days"=3, "From 29 to 56 days"=2, "From 1 to 4 days"=1, ">56 Days"=-1, "Drug started on or 
after the index day"=-3), 
                  selected = "From 5 to 28 days"),

      #select variable for criteria 2
      selectInput(inputId = "b", 
                  label = "Drug present in the body on index day",
                  choices = c("Drug continued up to index day or stopped at a time point less than five times the elimination half-life before the index day"=0,
                              "Drug stopped at a time point prior to the index day by more than five times the elimination half-life but liver or kidney function alterations or suspected drug interactions are present"=-1,
                              "Drug stopped at a time point prior to the index day by more than five times the elimination half-life, without liver or kidney function alterations or suspected drug interactions"=-3), 
                  selected = "Drug continued up to index day or stopped at a time point less than five times the elimination half-life before the index day"),
     #criteria 3
       selectInput(inputId = "c", 
                  label = "Prechallenge/rechallenge",
                  choices = c("SJS/TEN after use of same drug"=4,
"SJS/TEN after use of similar drug or other reaction with same drug"=2,
"Other reaction after use of similar drug"=1, "No known previous exposure to this drug"=0, "Exposure to this drug without any reaction (before or after reaction)"=-2), 
                  selected = "SJS/TEN after use of same drug"),

#criteria 4
selectInput(inputId = "d", 
            label = "Dechallenge",
            choices = c("Drug stopped (or unknown)"=0,
                        "Drug continued without harm"=-2),
                        selected = "Drug stopped (or unknown)"),     


#criteria 6
selectInput(inputId = "f", 
            label = "Other cause",
            choices = c("At least one other drug with score >3"=-1,"No other drug with score >3"=0),
            selected = "At least one other drug with score >3")
      ),

    # Outputs
    mainPanel(
      textOutput(outputId = "ALDEN")
    )
  )
)

# Define server function required to create the scatterplot
server <- function(input, output) {

notoriety<-reactive({
req(input$e)
ifelse(input$e=='Other',0,as.numeric(g$Notoriety.2013[which(g$DCI==input$e)]))
})

 score<-reactive({
   req(input$a, input$b, input$c, input$d, notoriety(), input$f)
as.numeric(input$a)+as.numeric(input$b)+as.numeric(input$c)+as.numeric(input$d)+as.numeric(input$f)+notoriety()
 })

 comment<-reactive({
req(score())
case_when(score()<0~"Very unlikely", score()==0|score()==1~"Unlikely",score()==2|score()==3~"Possible",
          score()==4|score()==5~'Probable', score()>5~"Very probable")
 })

 hl<-reactive({
   req(input$e)
   ifelse(input$e=='Other','Unknown',g$el[which(g$DCI==input$e)])
 })
  # Create scatterplot object the plotOutput function is expecting
  output$ALDEN <- renderPrint({
    paste0("ALDEN score = ",score(),' : ',comment(), ' |    Half-Life : ', hl())
  })
}

# Create a Shiny app object
shinyApp(ui = ui, server = server)

0 个答案:

没有答案