# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # ## Variable selection ## For this final app, we will add a tab that will plot two of the four variables in the data set USArrests against one another. ## ## To do this, we'd like to select specific variables, This is kind of like selectInput, but shiny has its own ## special-purpose version in varSelectInput(). ## to do this: ## * be sure to use data("USArrests") in the .R file ## * add a new tab that includes a varSelectInput and a new plotOutput ## * Add a server function that renders the plot based on the selected variable (see examples in shiny documentation.) library(plotly) library(shiny) library(ggplot2) library(bslib) ## for value_box data(USArrests) # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("Random distribution generation"), # Sidebar with a slider input for number of bins tabsetPanel( tabPanel("Overview", value_box( title = "Euchre Stats", value = data$x, theme = "text-success", showcase = plotOutput("plot_funding"), showcase_layout = "bottom", full_screen = TRUE ), card(card_header("This is a card"),"What a joker",card_footer("Not playing with a full deck")) ) ) ) server <- function(input, output,session) { data <- reactive( { if( input$type=="normal") { x <- rnorm(input$number) updateNumericInput(session,"bins",value=25) }else if(input$type=="uniform") { x <- runif(input$number) updateNumericInput(session,"bins",value=10) } x } ) summaryTable <- reactive( { a <- data() atab <-summary(as.data.frame(a)) atab } ) output$textdesc <- renderText( paste("using ",input$type," distribution with a mean of ", round(mean(data()),3), " and standard devation of",round(sd(data()),3),"\n") ) } # Run the application shinyApp(ui = ui, server = server)