Clean up observeEvent and eventReactive examples

This commit is contained in:
Winston Chang
2015-02-23 15:57:27 -06:00
parent 7410bb9e9a
commit bb2c8e5fd2
2 changed files with 4 additions and 4 deletions

View File

@@ -135,12 +135,12 @@ if (interactive()) {
server <- function(input, output) {
# Take an action every time button is pressed;
# here, we just print a message to the console
observeEvent(input$button, function() {
observeEvent(input$button, {
cat("Showing", input$x, "rows\\n")
})
# Take a reactive dependency on input$button, but
# not on any of the stuff inside the function
df <- eventReactive(input$button, function() {
df <- eventReactive(input$button, {
head(cars, input$x)
})
output$table <- renderTable({