View source: R/scatterPlotMatrix.R
setDistribType | R Documentation |
Tells which type of representation to use for distribution plots.
setDistribType(id, distribType)
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). |
No return value, called from shiny applications for side effects.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.