Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created July 24, 2019 15:57
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 cpsievert/7cc6573222e345942c7a352661627e55 to your computer and use it in GitHub Desktop.
Save cpsievert/7cc6573222e345942c7a352661627e55 to your computer and use it in GitHub Desktop.
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
shinyApp(
ui = fillPage(
fillCol(flex = c(NA, 1),
inputPanel(
selectInput("region", "Region:", choices = colnames(WorldPhones))
),
plotOutput("phonePlot", height = "100%")
)
),
server = function(input, output) {
output$phonePlot <- renderPlot({
barplot(WorldPhones[,input$region]*1000,
ylab = "Number of Telephones", xlab = "Year")
})
},
options = list(height = 600)
)
```
```{r, echo = FALSE}
session$onSessionEnded(stopApp)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment