setCutoffs | R Documentation |
Tells which cutoffs to use for each column.
setCutoffs(id, cutoffs)
id |
output variable to read from (id which references the requested plot) |
cutoffs |
Vector of list (one for each data column) of vector (one for each cutoff)
containing two values for continuous input (min and max value defining the cutoff),
or one value for categorical input (name of the category to keep),
or |
It's possible to filter some lines by defining cutoffs to apply to columns.
No return value, called from shiny applications for side effects.
if(interactive() && require(shiny)) {
library(shiny)
library(parallelPlot)
ui <- fluidPage(
sliderInput("brushSlider", "Brush for 'Sepal.Length' column:",
min = 4, max = 8, step = 0.1, value = c(4, 8)),
p("The slider controls the rows which are kept by cutoff (others are shaded)"),
parallelPlotOutput("parPlot")
)
server <- function(input, output, session) {
output$parPlot <- renderParallelPlot({
parallelPlot(iris)
})
observeEvent(input$brushSlider, {
cutoffs <- list()
cutoffs["Sepal.Length"] <- list(list(input$brushSlider))
parallelPlot::setCutoffs("parPlot", cutoffs)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.