![](/img/trans.png)
[英]If-statement caused problem to the downloadhandler() in shiny app
[英]Dropping the first column in the downloaded file within shiny app: downloadHandler problem
使用下面的代码,downloadHandler 很好地下载了我感兴趣的数据 (linedata_()) 并将其保存为 CSV 文件。 我希望将第一列放在下载的文件中。
output$downloadData_ <- downloadHandler(
filename = function() {
paste("Older_Pop_Sel", Sys.Date(), ".csv", sep = ".")
},
content = function(file) {
write.csv(linedata_(), file, row.names = T)
}
)
我们可以在编写 csv 时使用[-1]
忽略第一列。
output$downloadData_ <- downloadHandler(
filename = function() {
paste("Older_Pop_Sel", Sys.Date(), ".csv", sep = ".")
},
content = function(file) {
write.csv(linedata_()[-1], file, row.names = T)
}
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.