View source: R/scatterPlotMatrix.R
setCutoffs | R Documentation |
Tells which cutoffs to use for each pair of columns. It's possible to filter some points by defining cutoffs to apply to columns.
setCutoffs(id, cutoffs)
id |
output variable to read from (id which references the requested plot) |
cutoffs |
List of |
No return value, called from shiny applications for side effects.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.