This Works!非常感謝@Phi。
library(shiny)
ui = navbarPage(HTML("Title"),
tabPanel(HTML("<font size=3>Start</font>"),
sidebarPanel(width = 2,
fileInput('files', 'UPLOAD ManderMatcher EXPORT', multiple = TRUE, accept = c('text/csv','text/comma-separated-values','text/tab-separated-values','text/plain','.csv','.tsv')),
checkboxInput('header', 'Header', TRUE),
radioButtons('sep', 'Separator', c(Comma=',',Semicolon=';',Tab='\t'), selected=';'),
radioButtons('quote', 'Quote', c(None='','Double Quote'='"','Single Quote'="'"), selected='"'),
actionButton("Load", "APPLY DATA")
),
mainPanel(
tabsetPanel(
tabPanel("StaVst",
fluidRow(column(6, dataTableOutput("tabel1"))
)),
tabPanel("TabFsmSgh",
fluidRow(column(6, dataTableOutput("tabel2"))
)),
tabPanel("TabFsmVst",
fluidRow(column(6, dataTableOutput("tabel3"))
))
)
)
)
)
server = function(input, output, session) {
lst1 <- eventReactive(input$files, {
req(input$Load!=0)
lst <- list()
for(i in 1:length(input$files[,1])){
lst[[i]] <- read.csv(input$files[[i, 'datapath']], header = input$header, sep = input$sep, quote = input$quote,
stringsAsFactors =FALSE)
}
lst
})
output$tabel1 <- renderDataTable({
req(!is.null(input$files) & input$Load!=0)
lst1()[[1]]
})
output$tabel2 <- renderDataTable({
req(!is.null(input$files) & input$Load!=0)
lst1()[[2]]
})
output$tabel3 <- renderDataTable({
req(!is.null(input$files) & input$Load!=0)
lst1()[[3]]
})
}
shinyApp(ui = ui, server = server, options = list(launch.browser=TRUE))
據我所知,你不能。 shinyFiles用於查看服務器端文件系統。在你的機器上運行時考慮它的服務器。 – Phi
感謝@Phi的回覆。那麼瀏覽你的電腦上傳個人文件到服務器是無法實現的?這真是太遺憾了...... –
沒有說你不能。說你不能使用shinyFiles。看看Shiny – Phi