I am trying to make the output reactive. I am not able to execute it. Is it possible to achieve like this,
For example, the moment I enter no of datasets, in the textbox, I need to get so many "Choose the csv file" boxes. For example, if the input is 3, the output should be 3 boxes with "Choose the csv file" . Below is the code I tried for it
library(shinydashboard)
library(readxl)
out <- data.frame(baseFns = ls('package:base'))
ui <- dashboardPage(
dashboardHeader(title = "Loading data"),
dashboardSidebar(sidebarMenu(
menuItem("Load Data", tabName = "Load_Data", icon = icon("balance-scale")),
menuItem("Analysis", tabName = "Analysis", icon = icon("chart-bar"))
)),
dashboardBody(
tabItems(tabItem(tabName = "Load_Data",textInput("T", "No of data sets", value = 0,width = 150),
fluidRow(box(fileInput("datafile","Choose the csv file",multiple = TRUE,
accept = c("text/csv","text/comma-separated-values,text/plain",".csv")),width = 2)
),
fluidRow(box(title = "Dataset",uiOutput("filter_70"),width = 5000)))
))
)
server <- function(input,output){
output$contents <- renderTable({
file_to_read <- input$datafile
if(is.null(file_to_read))
return(NULL)
a <- read.csv(file_to_read$datapath)
head(a,n=15)
})
}
shinyApp(ui, server)