View source: R/scatterPlotMatrix.R
setZAxis | R Documentation |
Tells which column to use as reference to determine color of each points.
setZAxis(id, dim)
id |
Output variable to read from (id which references the requested plot). |
dim |
name of the column to use as reference. |
No return value, called from shiny applications for side effects.
if(interactive() && require(shiny)) {
library(shiny)
library(scatterPlotMatrix)
ui <- fluidPage(
fluidRow(
column(
2,
selectInput("zAxisSelect", "Z Axis:", colnames(iris))
),
column(
2,
checkboxInput("zAxisUsedCB", "Use Z Axis", FALSE)
)
),
scatterPlotMatrixOutput("spMatrix")
)
server <- function(input, output, session) {
output$spMatrix <- renderScatterPlotMatrix({
scatterPlotMatrix(iris)
})
observe({
scatterPlotMatrix::setZAxis(
"spMatrix",
if (input$zAxisUsedCB) input$zAxisSelect else NULL
)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.