Skip to content

Commit 001c187

Browse files
committed
Test of a shiny app
1 parent 179054e commit 001c187

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

inst/shiny/histogram.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Histogram with variable classes
2+
3+
ui <- fluidPage(
4+
titlePanel("Choix des classes pour un histogramme"),
5+
sidebarLayout(
6+
sidebarPanel(
7+
sliderInput(inputId = "bins", label = "Nombre de classes:",
8+
min = 1, max = 50, value = 30)
9+
),
10+
mainPanel(
11+
plotOutput(outputId = "distPlot")
12+
)
13+
)
14+
)
15+
16+
server <- function(input, output) {
17+
output$distPlot <- renderPlot({
18+
chart::chart(data = geyser, ~waiting) +
19+
ggplot2::geom_histogram(bins = input$bins,
20+
col = "white", fill = "#75AADB") +
21+
ggplot2::ylab("Fréquence")
22+
})
23+
}
24+
25+
geyser <- data.io::read("geyser", package = "MASS", lang = "fr")
26+
shinyApp(ui, server)

0 commit comments

Comments
 (0)