I want to read a csv file as input from user in Shiny and assign it to a variable in global.r file.The code I have in ui.R is
fileInput('file1', 'Choose CSV File',
accept=c('text/csv', 'text/comma-separated-values,text/plain', .csv'))
The code I have in main Panel of server.R is
textOutput('contents')
The code I have currently in server.R is
output$contents <- renderText({
if(is.null(input$file1))return()
inFile <- input$file1
data<-read.csv(inFile$datapath)
print(summary(data))
})
I want to assign this input$file1 to a variable called 'data' in global.r. Please let me know if this is possible. Thanks