Skip to content

Instantly share code, notes, and snippets.

@janezj

janezj/index.Rmd Secret

Last active February 12, 2018 22:34
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 janezj/fbe24aa93559f73bf5f76d8ceab61b6c to your computer and use it in GitHub Desktop.
Save janezj/fbe24aa93559f73bf5f76d8ceab61b6c to your computer and use it in GitHub Desktop.
R try reload
---
title: "test observe after reload"
runtime: shiny_prerendered
output:
html_document
---
```{r setup, include=FALSE}
library(shiny)
cnt <- 0
```
```{r context='render', echo=FALSE}
actionButton("do", "Click Me")
```
```{r context='render', echo=FALSE}
div(textOutput('tcnt'))
```
```{r context='server', echo =FALSE}
observeEvent(input$do, {
cnt <<- cnt +1
output$tcnt <- renderText(cnt)
})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment