setRegressionType {scatterPlotMatrix}R Documentation

Tells which type of regression to use for regression plots.

Description

Tells which type of regression to use for regression plots.

Usage

setRegressionType(id, regressionType)

Arguments

id

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

regressionType

Binary code indicating the type of regression plot (bit 1: linear, bit 2: loess).

Value

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

Examples

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

   ui <- fluidPage(
     checkboxInput("linearRegressionCB", "Linear Regression", FALSE),
     checkboxInput("loessCB", "Local Polynomial Regression", FALSE),
     p("The chech boxes controls type of regression to use for regression plots"),
     scatterPlotMatrixOutput("spMatrix")
   )

   server <- function(input, output, session) {
     output$spMatrix <- renderScatterPlotMatrix({
       scatterPlotMatrix(iris)
     })
     observe({
       linearFlag <- ifelse(input$linearRegressionCB, 1, 0)
       loessFlag <- ifelse(input$loessCB, 2, 0)
       scatterPlotMatrix::setRegressionType("spMatrix", linearFlag + loessFlag)
     })
   }

   shinyApp(ui, server)
 }


[Package scatterPlotMatrix version 0.2.0 Index]