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 '/var/folders/6_/gqrmklfs2vb00n2ksy7pthgh0000gn/T//RtmpnhMpxa/file63a82fe45b55': No such file or directory
我不确定为什么“R”会在那个特定的位置寻找。当我转到我的 Shiny 仪表板时,我可以看到应用程序已上传,但尚未部署。谢谢。
这是代码的最小版本。它涉及读取文本文件,并将其显示为 .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())
})
}
)
解决方案
我需要添加一张图片,因此使用 answer 方法:
您是否尝试过使用 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)
推荐阅读
- java - Java继承类中的构造函数可以为空吗
- java - 超时异常:等待 selenium webdriver 的 net.serenitybdd.core.pages.WebElementFacade 40 秒后超时
- python - 使用枚举的不同方式
- angular - Angular 2 - 切换/更改 div 以设置第一个位置
- java - 当测试用例在for循环中执行时,如何使用testNG获取测试用例描述/测试用例名称
- java - FirebaseUI 填充 ListView 文本未显示
- c# - 在 IIS 中执行相同代码的时间比在桌面应用程序中要长
- angularjs - 最初选中的复选框值未在 AngularJS 中的控制器中传递
- asp.net - 将 on-promise 数据库连接到 ASP.NET
- mysql - 如何使用 Codeigniter Rest Api 将多行插入 mysql