Importing data

To import data only when the data have been updated you can use the reactivePoll() function.

server <- function(input, output, session) {
  data <- reactivePoll(1000, session, 
    function() file.mtime("data.csv"),
    function() read.csv("data.csv")
  )
}

But for this simple example we can also use reactiveFileReader() function.

server <- function(input, output, session) {
  data <- reactiveFileReader(1000, session, "data.csv", read.csv)
}