lawyerslosa.blogg.se

Rstudio shiny tutorial
Rstudio shiny tutorial






We can add another input widget to let the user switch between plotting eruption time and wait time. You just have to change one word in the ggplot function and update the x-axis label. Try plotting the eruption time ( eruptions) instead of the waiting time.

rstudio shiny tutorial

We’ve been plotting the waiting variable, but what if you wanted to plot the eruptions variable instead? The faithful dataset includes two columns: eruptions and waiting. Hist(x, breaks = bins, col = 'darkgray', border = 'white') # draw the histogram with the specified number of bins # generate bins based on input$bins from ui.Rīins <- seq(min(x), max(x), length.out = input$bins + 1) # Define server logic required to draw a histogram # Show a plot of the generated distribution # Sidebar with a slider input for number of bins # Define UI for application that draws a histogram # Find out more about building applications with Shiny here:

rstudio shiny tutorial rstudio shiny tutorial

If RStudio has changed their demo app and your source code doesn’t look like this, replace it with the code below: You don’t have to do anything else at this step. Your RStudio interface should look like this now.








Rstudio shiny tutorial