1
Следующий код не работает. Что мне нужно изменить?Как установить scale_x_log10 (FALSE/TRUE) с помощью флажка в блестящем?
Конкретно: Я хочу, чтобы X-Axis изменилась на логарифмическую шкалу, когда галочка отмечена галочкой.
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")
})