Learn R Programming

parallelPlot (version 0.4.0)

setHistoVisibility: Histograms visibility

Description

Tells which columns have to be displayed with histograms.

Usage

setHistoVisibility(id, histoVisibility)

Value

No return value, called from shiny applications for side effects.

Arguments

id

output variable to read from (id which references the requested plot)

histoVisibility

Vector of boolean (one for each data column), TRUE if an histogram must be displayed; NULL is allowed, meaning no histogram must be displayed. A named list can also be provided to only indicate which columns must be assigned to a new display.

Examples

Run this code
 if(interactive() && require(shiny)) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
     checkboxInput("histCB", "Histogram Visibility", FALSE),
     p("The check box controls the visibility of histograms"),
     parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
     output$parPlot <- renderParallelPlot({
       parallelPlot(iris)
     })
     observeEvent(input$histCB, {
       histoVisibility <- rep(input$histCB, ncol(iris))
       parallelPlot::setHistoVisibility("parPlot", histoVisibility)
     })
   }

   shinyApp(ui, server)
 }

Run the code above in your browser using DataLab