1

这是我的一个简单测试应用程序的代码:

library(shiny)
library(shinydashboard)
library(googlesheets4)
library(googledrive)
library(DT)

drive_auth(email = "xxxx")

shinyws1<-gs4_create("WS1")
#table<-read_sheet("xxx")

# Define UI for application
ui <- fluidPage(
   
   # Application title
   titlePanel("Test App"),
   
   # Sidebar with a slider input for number of bins 
   sidebarLayout(
      sidebarPanel(
         numericInput("bins",
                     "Number of friends:",
                     min = 1,
                     max = 100,
                     value = 50),
         actionButton("submit","Submit",class="btn-success")
      ),
      
      # Show a plot of the generated distribution
      mainPanel(
         #blank so far
      )
   )
)


# Define server logic required to draw a histogram
server <- function(input, output) {
   
   #results<-reactive(input$bins)
  observeEvent(input$submit,{
    shinyws1 %>% sheet_append(as.data.frame(input$bins))
  }) 
  
   
}

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

它在我的本地服务器上工作正常。但是部署失败。

以下是在 Shinyio 服务器中部署后生成的错误消息:

Error in value[[3L]](cond) : Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.
  * Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

有谁知道如何修理它?我已经尝试了我在网上找到的所有解决方法,但没有奏效。

4

0 回答 0