setCutoffs: Cutoffs values

View source: R/parallelPlot.R

setCutoffsR Documentation

Cutoffs values

Description

Tells which cutoffs to use for each column.

Usage

setCutoffs(id, cutoffs)

Arguments

id

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

cutoffs

Vector of list (one for each data column) of vector (one for each cutoff) containing two values for continuous input (min and max value defining the cutoff), or one value for categorical input (name of the category to keep), or NULL if there is no cutoff to apply; NULL is allowed, meaning all columns are without cutoff. A named list can also be provided to only indicate which columns must be assigned to a new cutoff.

Details

It's possible to filter some lines by defining cutoffs to apply to columns.

Value

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

Examples

 if(interactive() && require(shiny)) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
       sliderInput("brushSlider", "Brush for 'Sepal.Length' column:",
           min = 4, max = 8, step = 0.1, value = c(4, 8)),
       p("The slider controls the rows which are kept by cutoff (others are shaded)"),
       parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
       output$parPlot <- renderParallelPlot({
           parallelPlot(iris)
       })
       observeEvent(input$brushSlider, {
           cutoffs <- list()
           cutoffs["Sepal.Length"] <- list(list(input$brushSlider))
           parallelPlot::setCutoffs("parPlot", cutoffs)
       })
   }

   shinyApp(ui, server)
 }


parallelPlot documentation built on April 19, 2023, 1:07 a.m.