Hello everyone,
I have been working on a Shiny application which is designed to calculate OR and DR from input data, then plot the resulting DR with its minimum and maximum values. The application runs perfectly in my local R environment, displaying both the calculated results and the plot as expected.
However, when I run the application in Shiny, an error occurs that states "An error has occurred. Check your logs or contact the app author for clarification." The calculated results are displayed correctly, but the plot does not render at all. I have checked my code thoroughly, and it seems to be fine with no apparent errors.
Here's a sample of the code I am using:
# Server side code
server <- function(input, output) {
observeEvent(input$calculate, {
# ...
# Code for calculations
# ...
# Plotting
output$plot <- renderPlot({
ggplot() +
geom_line(aes(x = 1:length(c(DR_min, DR, DR_max)),
y = c(DR_min, DR, DR_max)), color = "blue") +
geom_point(aes(x = 2, y = DR), color = "blue", size = 4) +
geom_vline(aes(xintercept = 2), color = "red") +
geom_vline(aes(xintercept = 2), ymin = 0, ymax = input$MID, color = "red", linetype = "dashed") +
theme_minimal()
})
})
}
shinyApp(ui = ui, server = server)
I have checked the app logs but there aren't any clear indications as to why the plot is not rendering.
Has anyone else encountered this issue? If so, how did you resolve it? Any guidance or suggestions would be greatly appreciated.
Best regards,
Fernando