setDistribType: Distribution plots

View source: R/scatterPlotMatrix.R

setDistribTypeR Documentation

Distribution plots

Description

Tells which type of representation to use for distribution plots.

Usage

setDistribType(id, distribType)

Arguments

id

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

distribType

Binary code indicating the type of distribution plot (bit 1: histogram, bit 2: density plot).

Value

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

Examples

 if(interactive() && require(shiny)) {
   library(shiny)
   library(scatterPlotMatrix)

   ui <- fluidPage(
     selectInput(
       "distribType",
       "Distribution Representation:",
       choices = list("Histogram" = 2, "Density Plot" = 1),
       selected = 2
     ),
     p("The selector controls type of representation to use for distribution plots"),
     scatterPlotMatrixOutput("spMatrix")
   )

   server <- function(input, output, session) {
     output$spMatrix <- renderScatterPlotMatrix({
       scatterPlotMatrix(iris)
     })
     observeEvent(input$distribType, {
       scatterPlotMatrix::setDistribType("spMatrix", input$distribType)
     })
   }

   shinyApp(ui, server)
 }


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