Learn R Programming

scatterPlotMatrix (version 0.3.0)

setCutoffs: 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)

Value

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

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.

Examples

Run this code
 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)
 }

Run the code above in your browser using DataLab