Asudespresentationshiny - Reproducible pitch

Asude Berber
09/09/2023

First Slide

For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.

  • Shiny App presentation
  • Code presentation

Slide With Code

library(shiny)

# Define UI for application that draws a histogram
fluidPage(

    # Application title
    titlePanel("Asudes production-time distribution"),

    # Sidebar with a slider input for number of bins
    sidebarLayout(
        sidebarPanel(
            sliderInput("bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30)
        ),

        # Show a plot of the generated distribution
        mainPanel(
            plotOutput("distPlot")
        )
    )
)

<!–html_preserve–>

Asudes production-time distribution

<!–/html_preserve–>

library(shiny)

# Define server logic required to draw a histogram
function(input, output, session) {

    output$distPlot <- renderPlot({

        # generate bins based on input$bins from ui.R
        Distribution    <- faithful[, 2]
        bins <- seq(min(Distribution), max(Distribution), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(Distribution, breaks = bins, col = 'darkgray', border = 'white',
             xlab = 'Waiting time to next eruption (in mins)',
             main = 'Histogram of waiting times')

    })

}
function(input, output, session) {

    output$distPlot <- renderPlot({

        # generate bins based on input$bins from ui.R
        Distribution    <- faithful[, 2]
        bins <- seq(min(Distribution), max(Distribution), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(Distribution, breaks = bins, col = 'darkgray', border = 'white',
             xlab = 'Waiting time to next eruption (in mins)',
             main = 'Histogram of waiting times')

    })

}

Slide With Plot

function(input, output, session) {

    output$distPlot <- renderPlot({

        # generate bins based on input$bins from ui.R
        Distribution    <- faithful[, 2]
        bins <- seq(min(Distribution), max(Distribution), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(Distribution, breaks = bins, col = 'darkgray', border = 'white',
             xlab = 'Waiting time to next eruption (in mins)',
             main = 'Histogram of waiting times')

    })

}

Citation