Skip to content
Permalink
main
Switch branches/tags
Go to file
@jjallaire
Latest commit 29b856b Aug 17, 2021 History
1 contributor

Users who have contributed to this file

---
title: "Old Faithful"
format:
html:
code-tools:
source: https://github.com/quarto-dev/quarto-web/tree/main/docs/interactive/shiny/_examples/old-faithful/shiny-old-faithful.qmd
server: shiny
---
Data on eruptions of the Old Faithful geyser in Yellowstone National Park,
Wyoming, USA. The data was collected continuously from August 1st until
August 15th, 1985.
```{r}
sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30)
plotOutput("distPlot")
```
The data consists of 299 pairs of measurements, referring to the time interval
between the starts of successive eruptions and the duration of the subsequent
eruption.
Click the **Code** button above to see the source code for this example.
```{r}
#| context: server
output$distPlot <- renderPlot({
x <- faithful[, 2] # Old Faithful Geyser data
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
```