Case Studies: Building Web Applications with Shiny in R
Dean Attali
Shiny Consultant
3 data sources for word cloud
artofwar
textAreaInput()
fileInput()
Next step: allow all together
radioButtons(
"time_of_day", "Choose your favorite time of day",
choices = c("Morning", "Afternoon", "Evening"),
selected = "Afternoon"
)
radioButtons(
"time_of_day", "Choose your favorite time of day",
choices = c("I'm a morning person!" = "Morning",
"Love my afternoons" = "Afternoon",
"Night owl here!" = "Evening"),
selected = "Afternoon"
)
str(input$time_of_day)
chr "Afternoon"
conditionalPanel(condition, ...)
condition
is similar to R code, but input$<id>
is replaced by input.<id>
...
is any UIui <- fluidPage(
radioButtons("time_of_day",
"Choose your favorite time of day",
...),
plotOutput("morning_only_plot")
)
ui <- fluidPage(
radioButtons("time_of_day",
"Choose your favorite time of day",
...),
conditionalPanel(
condition = "input.time_of_day == 'Morning'",
plotOutput("morning_only_plot")
)
)
Case Studies: Building Web Applications with Shiny in R