Skip to content

Instantly share code, notes, and snippets.

@sckott
Created November 9, 2013 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckott/7388855 to your computer and use it in GitHub Desktop.
Save sckott/7388855 to your computer and use it in GitHub Desktop.
# server.r
shinyServer(function(input, output, session) {
readTimestamp <- function() Sys.time()
df <- data.frame(time=Sys.time())
readValue <- function(){
rbind(df, data.frame(time=readTimestamp()))
}
data <- reactivePoll(1000, session, readTimestamp, readValue)
output$dataTable <- renderTable({
data()
})
})
# ui.r
require(rCharts)
shinyUI(
mainPanel(
tableOutput(outputId="dataTable")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment