Problem:
The graph plot does not Render. There are no errors.
Description:
Even though I do not use a reactive value below, it should work because it is within an observed event. Rendering a table works perfectly fine.
Additional Info
The AllElements Data is definitely populated! I printed them out to check. They are vectors of type double.
library(shiny)
library(shinyWidgets)
library(shinythemes)
library(datasets)
shinyApp(
ui = navbarPage(
"Real Time Instruments",
############################# Page 1 #############################
tabPanel("Training",
mainPanel(
actionButton("analyse", "Train Model", width = "100%")
)
############################# Page 2 #############################
),
tabPanel("Results",
tableOutput ( "error"),
plotOutput("predict_plot", inline = TRUE)
)
),
server = function(input, output, session) {
### Analyse the data
analyse <- observeEvent(input$analyse , {
# Run the Analysis
AllElements <- data.frame( x = 1:10 )
# populate the results
populateResults (AllElements)
})
#### Results Page ####
populateResults <- function (allElements) {
# First the error table
output$error <- renderTable(allElements$error_sd, digits = 5) ## <--- THIS WORKS!!!
# Second Plots
# par(mar = rep(2, 4)) # Might be needed
x <- allElements$x
xlab <- allElements$x
y <- allElements$x
ylab <- allElements$x
# Plot Predict Var
output$predict_plot <- renderPlot({plot (x, y)}) # <--- THIS DOESN'T WORK!!!
}
})
}
)
AnalyseData
available. – Felix Grossmann