이 모든 기본 질문에 대해 약간 어리석은 느낌이 들지만, 이것에 대해서는 아무 것도 찾을 수 없습니다. 내 테이블의 'Excel'버튼을 클릭하면 사용자가 파일의 이름을 지정할 수 있습니다. 다운로드 대화 상자가 열리거나 이름을 입력 할 수있는 다른 UI가 나타납니다. 그게 가능하니? 현재이 이름은 앱의 태그와 같습니다.버튼 확장명의 파일 이름을 사용자 정의하십시오.
rm(list=ls())
library(shiny)
library(datasets)
library(DT)
library(data.table)
DT<-data.table(matrix(abs(rnorm(600*40,sd=100)),nrow=600))
server<-shinyServer(function(input, output) {
output$view <- DT::renderDataTable(
DT[,.SD],extensions = c('FixedHeader','Buttons'),
options=list(pageLength=60,fixedHeader = TRUE,dom = 'Bfrtip',buttons = c('csv', 'excel' )))
})
ui<-shinyUI(fluidPage(
titlePanel("Shiny MWE"),
DT::dataTableOutput("view")
))
runApp(list(ui=ui,server=server))
나는이 가능하다 생각하지 않는다 있습니다. 파일 이름은 옵션의 매개 변수입니다 (https://github.com/rstudio/DT/issues/343#issuecomment-239600594). 옵션은 반응이 없으므로 파일 이름이 변경 될 때마다 테이블을 다시 그려야합니다. . – Carl
하지만 다른 이름을 선택하기 위해 어딘가에 파일 이름 옵션을 추가 할 수 있습니까? –
예, 컴퓨터 앞에있을 때 대답을 게시합니다 – Carl