setKeptColumns | R Documentation |
Tells which columns have to be visible.
setKeptColumns(id, keptColumns)
id |
output variable to read from (id which references the requested plot) |
keptColumns |
Vector of boolean (one for each data column), |
No return value, called from shiny applications for side effects.
if(interactive()) { library(shiny) library(parallelPlot) ui <- fluidPage( checkboxInput("hideColumnsCB", "Hide last columns", FALSE), p("The check box controls the visibility of the two last columns"), parallelPlotOutput("parPlot") ) server <- function(input, output, session) { output$parPlot <- renderParallelPlot({ parallelPlot(mtcars) }) observeEvent(input$hideColumnsCB, { keptColumns <- vapply( 1:ncol(mtcars), function(i) { return(ifelse(input$hideColumnsCB, ncol(mtcars) - i >= 2, TRUE)) }, logical(1) ) parallelPlot::setKeptColumns("parPlot", keptColumns) }) } shinyApp(ui, server) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.