if(interactive() && require(shiny)) {
library(shiny)
library(parallelPlot)
ui <- fluidPage(
checkboxInput("orientationCB", "Axis orientation", FALSE),
p("The check box controls the orientation of axes"),
parallelPlotOutput("parPlot")
)
server <- function(input, output, session) {
output$parPlot <- renderParallelPlot({
parallelPlot(iris)
})
observeEvent(input$orientationCB, {
invertedAxes <- rep(input$orientationCB, ncol(iris))
parallelPlot::setInvertedAxes("parPlot", invertedAxes)
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab