highlightPoint {scatterPlotMatrix} | R Documentation |
Row highlight
Description
Asks to change the highlighted row.
Usage
highlightPoint(id, pointIndex)
Arguments
id |
output variable to read from (id which references the requested plot) |
pointIndex |
index of the point to highlight; |
Value
No return value, called from shiny applications for side effects.
Examples
if(interactive() && require(shiny)) {
library(shiny)
library(scatterPlotMatrix)
ui <- fluidPage(
actionButton("highlightPointAction", "Highlight Last Point"),
actionButton("clearHlPointAction", "Remove Highlighting"),
p("These buttons sets/unsets a selected line"),
scatterPlotMatrixOutput("spMatrix")
)
server <- function(input, output, session) {
output$spMatrix <- renderScatterPlotMatrix({
scatterPlotMatrix(iris)
})
observeEvent(input$highlightPointAction, {
lastRowIndex <- nrow(iris)
scatterPlotMatrix::highlightPoint("spMatrix", lastRowIndex)
})
observeEvent(input$clearHlPointAction, {
scatterPlotMatrix::highlightPoint("spMatrix", NULL)
})
}
shinyApp(ui, server)
}
[Package scatterPlotMatrix version 0.3.0 Index]