Skip to content

Instantly share code, notes, and snippets.

@paulditterline
Created May 29, 2016 19:30
Show Gist options
  • Save paulditterline/25242ff34a44ee0ceb1457125544b15a to your computer and use it in GitHub Desktop.
Save paulditterline/25242ff34a44ee0ceb1457125544b15a to your computer and use it in GitHub Desktop.
Flex dashboard fails only in mobile
---
title: "Mobile Fail Example"
output:
flexdashboard::flex_dashboard:
theme: yeti
storyboard: true
social: menu
source: embed
runtime: shiny
---
```{r setup, include=FALSE}
# Load Packages
library(dplyr)
library(ggplot2)
library(shiny)
# GGplot Theme
theme_set(theme_gray(base_size=13))
# Pull Data
df <- mtcars
```
Inputs {.sidebar}
-------------------------------------
Here is some Text!
```{r}
selectInput("cars","cars",levels(factor(df$cyl)))
selectInput("morecars","morecars",row.names(df))
```
### 1) A plot
```{r}
totals <- df %>%
group_by(cyl) %>%
summarise(N=n())
renderPlot({
ggplot(totals, aes(x=cyl,y=N))+
geom_bar(stat="identity")
})
```
***
Text
### 2) Another Plot
```{r}
myreactive <- reactive({
df %>%
filter(cyl == input$cars)
})
renderPlot({
ggplot(myreactive(), aes(x=mpg,y=hp))+
geom_point()
})
```
***
```{r}
checkboxGroupInput("test","test",choices=levels(factor(df$carb)))
```
### Words words words
***
```{r}
maxsal <- renderText({
as.character(myreactive()[1,1])
})
overtime <- renderText({
as.character(myreactive()[2,1])
})
```
work word `r maxsal` word word `r overtime`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment