-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.R
More file actions
51 lines (37 loc) · 1.28 KB
/
Copy pathapp.R
File metadata and controls
51 lines (37 loc) · 1.28 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# voy a hacer unos cambios de prueba
#
# https://shiny.posit.co/
#
library(shiny)
library(bslib)
# Define UI for application that draws a histogram
ui <- page_sidebar(
title = "App_2 UAI",
# Application title
sidebar = sidebar(class = "Old Faithful Geyser Data",
sliderInput("bins",
"Number of bins:",
min = 1,
max = 65,
value = 30)),
# Show a plot of the generated distribution
card (card_header(class = "bg-dark","Gráficos de Barras"),
mainPanel(
plotOutput("bill_length"))
))
# Define server logic required to draw a histogram
server <- function(input, output) {
output$bill_length <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white',
xlab = 'Waiting time to next eruption (in mins)',
main = 'Histogram of waiting times')
})
bs_themer()
}
# Run the application
shinyApp(ui = ui, server = server)