library(flexdashboard) library(ggplot2)
data(wine_data, package = "WineReviews")
shiny::selectInput( "country", label = "select country", choices = sort(unique(wine_data$country)) )
shiny::renderPlot( ggplot(wine_data[wine_data$country == input$country, ], aes(points, log10(price), group = points)) + geom_boxplot() + labs(x = "points scored by the wine on a 100 scale", y = "Base-10 logarithm of the wine price") + theme_bw() )
shiny::renderPlot( ggplot(wine_data[wine_data$country == input$country, ], aes(price)) + geom_density() + labs(y = "Price density function") + theme_bw() )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.