How to read file from user in Shiny and assign it to a variable in global.r?
I have added the following code to global.R file

data &lt;- reactiveValues()


I used assign function in server.R to assign values to data in global.r

output$contents &lt;- renderText({    
      if(is.null(input$file1))return()
      inFile &lt;- input$file1
      data2&lt;-read.csv(inFile$datapath)
  assign('data',data2,envir=.GlobalEnv)
  print(summary(data))
 })