1
Der folgende Code funktioniert nicht. Was muss ich ändern?Wie setze ich scale_x_log10 (FALSE/TRUE) durch Checkbox in glänzend?
Spezifisch: Ich möchte die X-Achse auf logarithmische Skala ändern, wenn ein Kontrollkästchen aktiviert ist.
ui <- shinyUI(fluidPage(
...
checkboxInput("logarithmicX", "show x-axis in log10", FALSE),
checkboxInput("logarithmicY", "show y-axis in log10", FALSE),
...
))
server <- shinyServer(function(input, output) {
output$distPlot <- renderPlot({
...
xlog <- reactive({
switch(input$logarithmicX,
TRUE == TRUE,
FALSE == FALSE)
})
ylog <- reactive({
switch(input$logarithmicY,
TRUE == TRUE,
FALSE == FALSE)
})
ggplot(datasetInput(), aes(size)) + geom_histogram(bins = biins) + theme_bw() + scale_x_log10("logarithmicX") +scale_y_log10("logarithmicY")
})