could I make fileInput widget disappear after file input? Or could I get rid of the blue progress bar?
Thank you!
could I make fileInput widget disappear after file input? Or could I get rid of the blue progress bar?
Thank you!
Hello Stéphane Laurent answered a similar question in this post, with a minimal example it gives :
data("kyphosis", package = "rpart")
write.table(kyphosis, file = "kyphosis.txt", row.names = FALSE)
library(shiny)
runApp(list(
ui = pageWithSidebar(
headerPanel = headerPanel(" "),
sidebarPanel = sidebarPanel( conditionalPanel(condition = "output.fileUploaded",
fileInput(inputId = "file_input", label = "Input" ) )),
mainPanel = mainPanel( tableOutput(outputId = "table"))
),
server = function(input, output) {
getData <- reactive({
if(is.null(input$file_input)) {
return(NULL)
} else {
return(read.table(input$file_input$datapath, header = TRUE))
}
})
output$fileUploaded <- reactive({
return(is.null(getData()))
})
output$table <- renderTable({
head(getData())
})
outputOptions(output, 'fileUploaded', suspendWhenHidden=FALSE)
}
))