zu diesem Beitrag Basierend: create plots based on radio button selection R ShinyR glänzend Plots basierend auf Radio-Buttons und Slider Eingang
Ich möchte einen anderen Plot Ausgang je nachdem, welche Funkoption der Benutzer auswählt und stellen Sie die Anzahl der Ausschüsse den Slider-Eingang.
Der Schieberegler funktioniert nicht und ich weiß nicht, wie ich das Problem lösen kann. Vielen Dank für die Hilfe!
Hier ist mein Code:
library(shiny)
library(Cubist)
plotType <- function(x, type, committe) {
switch(type,
Cond = dotplot(finalModel, what = "splits"),
Coeff = dotplot(finalModel, what = "coefs"))
}
ui <- shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
radioButtons(inputId = "ptype", label = "Select the plot", choices = c("Cond", "Coeff")),
sliderInput(inputId = "commit", min=1, max = 25, value = 2)
),
mainPanel(
plotOutput("plots"))
)))
server <- shinyServer(function(input, output) {
output$plots <-renderPlot({
plotType(finalModel, input$ptype, input$commit)
})
})
shinyApp(ui = ui, server = server)
Vielen Dank für Ihren Kommentar. Ich habe das gelöscht. Es hat das Problem leider nicht behoben. Irgendwelche anderen Ideen? Danke – Julia