setCorrPlotType: Correlation plot type

View source: R/scatterPlotMatrix.R

setCorrPlotTypeR Documentation

Correlation plot type

Description

Tells which type of correlation plot to use.

Usage

setCorrPlotType(id, corrPlotType)

Arguments

id

Output variable to read from (id which references the requested plot).

corrPlotType

One of the available correlation plot types (Empty, Circles, Text, AbsText).

Value

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

Examples

 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)
 }


scatterPlotMatrix documentation built on June 22, 2024, 10:50 a.m.