rdrop2 shinyapp在本地工作,但由于启动时间太长,无法部署到shinyapps.io,遵循各种建议仍然无法正常工作
我正在尝试获得一个shinyapp,它通过drop box使用持久数据存储来部署到shinyapps.io。该应用程序在本地工作,但当我部署它时,它说出现了一个错误,60秒后无法连接到worker;启动时间太长了 我曾尝试以各种方式更改顶部的令牌部分,但无法将其部署,尽管部署已完成,并且日志显示我看不到任何错误。(见下文) 现行代码 这里是我使用的最基本的代码,如果有任何帮助,我将不胜感激rdrop2 shinyapp在本地工作,但由于启动时间太长,无法部署到shinyapps.io,遵循各种建议仍然无法正常工作,shiny,shinydashboard,shinyapps,rdrop2,Shiny,Shinydashboard,Shinyapps,Rdrop2,我正在尝试获得一个shinyapp,它通过drop box使用持久数据存储来部署到shinyapps.io。该应用程序在本地工作,但当我部署它时,它说出现了一个错误,60秒后无法连接到worker;启动时间太长了 我曾尝试以各种方式更改顶部的令牌部分,但无法将其部署,尽管部署已完成,并且日志显示我看不到任何错误。(见下文) 现行代码 这里是我使用的最基本的代码,如果有任何帮助,我将不胜感激 library(shiny) library(shinydashboard) library(rdrop2
library(shiny)
library(shinydashboard)
library(rdrop2)
library(DT)
library(rsconnect)
rsconnect::deployApp
token <- drop_auth()
saveRDS(token, "my-token.rds")
drop_auth(rdstoken = "my-token.rds")
outputDir <- "Games"
fields <-
c("Date","Umpire","UIN","Level","HomeTeam","AwayTeam","Coach","Assessor",
"Assessment","Good1","Good2","Bad1","Bad2","FurtherN")
title<-tags$b(tags$img(src="WHUA_Logo.jpg",width=50, height=50),'WHUA Umpiring Game Tracker and
Reflection App')
ui <-dashboardPage(skin= "yellow", #this gives the main app background colour
dashboardHeader(
title = title, titleWidth = 700),
## all mydashboard stuff
server <- function(input, output) {
saveData <- function(data) {
data <- t(data)
# Create a unique file name
fileName <- sprintf("WHUAAppData3.csv", as.integer(Sys.time()), digest::digest(data))
# Write the data to a temporary file locally
filePath <- file.path(tempdir(), fileName)
write.csv(data, filePath, row.names = FALSE, quote = TRUE)
# Upload the file to Dropbox
drop_upload(filePath, path = outputDir)
}
loadData <- function() {
filesInfo <- drop_dir(outputDir)
filePaths <- filesInfo$path_display
data <- lapply(filePaths, drop_read_csv, stringsAsFactors = FALSE)
# Concatenate all data together into one data.frame
data <- do.call(rbind, data)
data
}
# Whenever a field is filled, aggregate all form data
#formData is a reactive function
formData <- reactive({
data <- sapply(fields, function(x) input[[x]])
data
})
# When the Save button is clicked, save the form data
observeEvent(input$save,{
saveData(formData())
})
# Show the previous responses
# (update with current response when save is clicked)
output$responses <- DT::renderDataTable({
input$save
loadData()
})
shinyApp(ui = ui, server = server)
```
库(闪亮)
图书馆(shinydashboard)
图书馆(rdrop2)
图书馆(DT)
图书馆(rsconnect)
rsconnect::deployApp
标记这里的问题是过度复杂
token <- drop_auth()
saveRDS(token, "my-token.rds")
在您的全球环境中。希望这能在将来帮助其他人
token <- drop_auth()
saveRDS(token, "my-token.rds")
drop_auth(rdstoken = "my-token.rds")