Dear All,
I am relatively new to shiny, so sorry if this is a "stupid" question.
I am currently trying to create my first shiny app, but if I create a shiny web app and simply click the "Run App" button R does not load the app.
This is the default shiny app I am trying to execute:
r
library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# 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")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- 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')
})
}
# Run the application
shinyApp(ui = ui, server = server)
In addition here is the sessionInfo():
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=German_Austria.1252 LC_CTYPE=German_Austria.1252 LC_MONETARY=German_Austria.1252
[4] LC_NUMERIC=C LC_TIME=German_Austria.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.6.0
loaded via a namespace (and not attached):
[1] compiler_4.1.0 fastmap_1.1.0 ellipsis_0.3.2 magrittr_2.0.1 R6_2.5.0 promises_1.2.0.1
[7] later_1.2.0 htmltools_0.5.1.1 tools_4.1.0 Rcpp_1.0.6 digest_0.6.27 xtable_1.8-4
[13] httpuv_1.6.1 lifecycle_1.0.0 mime_0.11 rlang_0.4.11
thanks for any advice or solution.
Best,
Fabian