You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I'm not sure if this is possible or not. Right now whenever you change the threshold in a shiny app, the whole figure gets redrawn from scratch. This is a bit misleading because the threshold does not affect the rest of the figure. This is a basic example:
## app.R ##
library(shiny)
library(shinydashboard)
library(IMPosterior)
set.seed(9782)
x <- rnorm(n = 1000, mean = 3, sd = 2)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sliderInput(
"threshold",
h4("Decision Threshold:"),
min = 50,
max = 99,
value = 75,
step = 1,
post = "%"
)
),
dashboardBody(
box(
title = "Posterior Distribution",
status = "primary",
solidHeader = TRUE,
width = 6,
IMPosteriorOutput("plot", width = "100%")
)
)
)
server <- function(input, output) {
output$plot <- renderIMPosterior({
p <- IMPosterior(x = x, MME = 1, threshold = input$threshold/100)
return(p)
})
}
shinyApp(ui, server)
The text was updated successfully, but these errors were encountered:
First, I'm not sure if this is possible or not. Right now whenever you change the
threshold
in a shiny app, the whole figure gets redrawn from scratch. This is a bit misleading because the threshold does not affect the rest of the figure. This is a basic example:The text was updated successfully, but these errors were encountered: