Shiny 如何部署我的闪亮应用程序?(打开连接时出错)

Shiny 如何部署我的闪亮应用程序?(打开连接时出错),shiny,Shiny,我似乎无法部署闪亮的应用程序。这就是我得到的错误 > deployApp() Preparing to deploy application...DONE Uploading bundle for application: 565580...Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : cannot open file '/va

我似乎无法部署闪亮的应用程序。这就是我得到的错误

> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 565580...Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file '/var/folders/6_/gqrmklfs2vb00n2ksy7pthgh0000gn/T//RtmpnhMpxa/file63a82fe45b55': No such file or directory
我不知道为什么“R”在那个特定的位置。当我转到我闪亮的仪表板时,我可以看到应用程序已上载,但尚未部署。谢谢

下面是代码的最低版本。它涉及读取文本文件,并将其显示为.html对象

shinyApp(

  ui <- fluidPage(
    sidebarLayout(
      sidebarPanel(
        fileInput("text_file", "Choose text file",
                  multiple = FALSE,
                  accept = c(".txt")
        )
      ),
      mainPanel(htmlOutput("example"))
    )
  ), 

  server <- function(input, output, session){

    text <- reactive({
      req(input$text_file)
      x <- scan(input$text_file$datapath, what = "string", sep = "\n")

    })

    # text output
    output$example <- renderUI({
      HTML(text())
    })
  }



    )
shinyApp(

ui我需要添加一张图片,因此使用回答方法:

您是否尝试过使用RStudio功能

更新

我必须编辑您的代码才能获得该选项:

library(shiny)  

ui <- fluidPage(
    sidebarLayout(
      sidebarPanel(
        fileInput("text_file", "Choose text file",
                  multiple = FALSE,
                  accept = c(".txt")
        )
      ),
      mainPanel(htmlOutput("example"))
    )
  )

server <- function(input, output, session){

  text <- reactive({
    req(input$text_file)
    x <- scan(input$text_file$datapath, what = "string", sep = "\n")

  })

  # text output
  output$example <- renderUI({
    HTML(text())
  })
}

shinyApp(ui, server)
库(闪亮)

ui请添加您的代码或至少一个最小的reprex供我们测试。代码扩展了几百行。这是一个极其复杂的应用程序。我不确定如何将其轻松分解为更小的块。另外,所有代码都是以R为基数的。好的-即使只有一个最小的示例,也会出现错误。我已经发布了此消息。干杯。您的代码工作的事实让我非常高兴意识到这不是代码中的错误。这只是在部署应用程序时指定容器文件夹的完整路径的一个例子。很高兴我能提供帮助-尽管是以一种迂回的方式。