setCutoffs {scatterPlotMatrix} | R 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 |
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)
}
[Package scatterPlotMatrix version 0.3.0 Index]