Я пытаюсь создать блестящее приложение, которое генерирует график зависимости (размера выборки) от (мощности).Мое приложение правильно отображает все параметры для пользовательского ввода, но не отображает график, который я хочу, чтобы система сгенерировала.
Не могли бы вы помочь мне с этим?Ниже мой код:
ui <- fluidPage(
selectInput("diagType", "Diagnosis Outcome of Interest:", c("Cancer", "Sepsis", "SIRS")),
selectInput("alpha", "Significance Level:", c("0.05", "0.01", "0.001")),
conditionalPanel( condition = "input.diagType == 'Cancer'",
sliderInput("bin1", label = "Cut off level for TK:", min=1, max=20, value=10),
sliderInput("bin2", label = "Cut off level for AGE:", min=1, max=12, value=6),
sliderInput("bin3", label = "Cut off level for BW:", min=1, max=40, value=20)),
conditionalPanel( condition = "input.diagType == 'Sepsis'",
sliderInput("bin4", label = "Cut off level for CRP:", min=1, max=45, value=22.5),
sliderInput("bin5", label = "Cut off level for WBC:", min=1, max=25, value=12.5),
sliderInput("bin6", label = "Cut off level for Temp:", min=100, max=105, value=103)),
conditionalPanel( condition = "input.diagType == 'SIRS'",
sliderInput("bin7", label = "Cut off level for CNP:", min=1, max=16, value=8),
sliderInput("bin8", label = "Cut off level for Pulse:", min=95, max=180, value=135)),
plotOutput("plot")
)
output$plot <- renderPlot({
if (input$diagType=='Cancer'){
d <- data()
plot(d$power.vec, d$cancer.sample.size)
}
})
output$plot <- renderPlot({
if (input$diagType=='Sepsis'){
d <- data()
plot(d$power.vec, d$sepsis.sample.size)
}
})
output$plot <- renderPlot({
if (input$diagType=='SIRS'){
d <- data()
plot(d$power.vec, d$SIRS.sample.size)
}
})
}
shinyApp(ui, server)