-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathshiny-old-faithful.qmd
More file actions
32 lines (27 loc) · 961 Bytes
/
shiny-old-faithful.qmd
File metadata and controls
32 lines (27 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
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')
})
```