0
ユーザーがボタンをクリックすると、データテーブルの出力をcsvに書きたいと思います。私はダウンロード機能光沢のあるダッシュボードのdownloadButton関数が機能しない
ui.r
tabItem(tabName = "output",
h2("Resource Predictions"),
fluidRow(
box(
width = 3, status = "info",solidHeader = TRUE,
title = "QC Assignment",
tableOutput("qc_assign")
),
box(
width = 9, status = "info",solidHeader = TRUE,
title = "ITV Assignment",
DT::dataTableOutput("itv_seq")
)),
fluidRow(
downloadButton("downloadtable", "Download ITV assignment file",style="display: block; margin: 0 auto; width: 230px;color: blue;"))
),
のためにRに次のコードを書かれていると私server.rファイルは、私がDownload ITV assignment file
ボタンをクリックすると
qc_assignment <- reactive({
.
.
.
list(ITV_assign = itv_assign)
})
output$downloadtable <- downloadHandler(
itv_seq <- qc_assignment()[['ITV_assign']],
filename = function() {paste("ITV_assignement_",input$ves_arrv_date,".csv",sep="")},
content = function(file){ write.csv(itv_seq, file) }
)
を以下のように見える、ファイルブラウザが開き、それが保存されますdownloadtable
という名前のファイルで、.csv
拡張子はありません。
私は間違っていますか?
私はあなたの提案をしましたが、それでも '.csv'拡張子なしで' downloadtable'として保存しました – Neil
'https:// shiny.rstudio.com/reference/shiny/latest/downloadHandler.html'あなたのために働く? – shosaco
上記のリンクは存在しません。 '404 not found' – Neil