【发布时间】:2017-12-27 16:22:54
【问题描述】:
我正在寻找一种通过生成 .txt 文件来下载应用程序上显示的文本的方法。这是我的尝试,不幸的是没有成功:
library(shiny)
ui <- fluidPage(
sidebarPanel(
h4("Title"),
p("Subtitle",
br(),"Line1",
br(),"Line2",
br(),"Line3"),
downloadButton("Download Metadata", label = "Download")
)
)
server <- function(input, output, session){
output$downlaodData <- downloadHandler(
filename = function(){
paste("data-", Sys.Date(), ".txt", sep = "")
},
content = function(file) {
write.txt(data, file)
}
)
感谢您的帮助
【问题讨论】:
标签: r shiny shiny-server shinydashboard