View source: R/scatterPlotMatrix.R
setCorrPlotType | R Documentation |
Tells which type of correlation plot to use.
setCorrPlotType(id, corrPlotType)
id |
Output variable to read from (id which references the requested plot). |
corrPlotType |
One of the available correlation plot types ( |
No return value, called from shiny applications for side effects.
if(interactive() && require(shiny)) {
library(shiny)
library(scatterPlotMatrix)
ui <- fluidPage(
selectInput(
"corrPlotTypeSelect",
"Correlation Plot Type:",
choices = list(
"Empty" = "Empty",
"Circles" = "Circles",
"Text" = "Text",
"AbsText" = "AbsText"
),
selected = "Circles"
),
p("The selector controls the type of correlation to use"),
scatterPlotMatrixOutput("spMatrix")
)
server <- function(input, output, session) {
output$spMatrix <- renderScatterPlotMatrix({
scatterPlotMatrix(iris, zAxisDim = "Sepal.Length", continuousCS = "Plasma")
})
observeEvent(input$corrPlotTypeSelect, {
scatterPlotMatrix::setCorrPlotType("spMatrix", input$corrPlotTypeSelect)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.