-
-
Save janezj/fbe24aa93559f73bf5f76d8ceab61b6c to your computer and use it in GitHub Desktop.
R try reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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