setCutoffs: Cutoffs values

View source: R/scatterPlotMatrix.R

setCutoffsR Documentation

Cutoffs values

Description

Tells which cutoffs to use for each pair of columns. It's possible to filter some points by defining cutoffs to apply to columns.

Usage

setCutoffs(id, cutoffs)

Arguments

id

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

cutoffs

List of SpCutoff; a SpCutoff is a list defining a xDim, yDim and a list of xyCutoff; a xyCutoff is a pair of cutoff (one for x axis, one for y axis); a cutoff is a list containing two values (min and max values) or NULL if there is no cutoff to apply for this axis; NULL is allowed, meaning there is no cutoff to apply.

Value

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

Examples

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

   ui <- fluidPage(
     checkboxInput("setosaCB", "Setosa", TRUE),
     checkboxInput("versicolorCB", "Versicolor", TRUE),
     checkboxInput("viginicaCB", "Viginica", TRUE),
     scatterPlotMatrixOutput("spMatrix")
   )

   server <- function(input, output, session) {
     output$spMatrix <- renderScatterPlotMatrix({
       scatterPlotMatrix(
         data = iris,
         zAxisDim = "Species"
       )
     })

     observe({
       speciesCBs = c(input$setosaCB, input$versicolorCB, input$viginicaCB)
       toKeepIndexes <- Filter(function(i) speciesCBs[i], 1:length(speciesCBs))
       xyCutoffs <- sapply(toKeepIndexes, function(i) {
         list(list(NULL, c(i - 1.1, i - 0.9)))
       })
       scatterPlotMatrix::setCutoffs("spMatrix", list(
         list(xDim="Sepal.Length", yDim="Species", xyCutoffs = xyCutoffs)
       ))
     })
   }
   shinyApp(ui, server)
 }


scatterPlotMatrix documentation built on June 22, 2024, 10:50 a.m.