mark {rlc}R Documentation

Mark elements of a chart

Description

mark selects a set of elements in a given chart. It is equivalent to selecting elements interactively by drawing a rectangle with the mouse while holding the Shift key. This function is a wrapper of method mark of class LCApp.

Usage

mark(
  elements = NULL,
  chartId = NULL,
  layerId = NULL,
  preventEvent = TRUE,
  clear = FALSE,
  sessionId = NULL
)

Arguments

elements

numeric vector of indices of the elements to select.

chartId

ID of the chart where to select elements (can be omitted if there is only one chart).

layerId

ID of the layer where to select elements (can be omitted if the chart has only one layer).

preventEvent

if TRUE, on_marked callback function will not be called. Can be used to prevent endless stacks of calls.

clear

if TRUE, all previously marked elements will be unmarked, otherwise new elements will be added to a set of currently marked ones.

sessionId

An ID of the session for which to mark elements. Can be NULL if there is only one active session. Otherwise must be a valid session ID. Check Session for more information on client sessions. If a call to this function was triggered from an opened web page, ID of the corresponding session will be used automatically.

Examples

## Not run: data("iris")
openPage(FALSE, layout = "table1x2")

#brushing example
#Hold Shift pressed and select a group of point on one of the charts

lc_scatter(dat(
  x = iris$Sepal.Length,
  y = iris$Petal.Length,
  colourValue = iris$Species,
  on_marked = function() {
    mark(getMarked("A1"), "A2")
  }
), "A1")

lc_scatter(dat(
  x = iris$Sepal.Width,
  y = iris$Petal.Width,
  colourValue = iris$Species,
  on_marked = function() {
    mark(getMarked("A2"), "A1")
  }
), "A2")
## End(Not run)


[Package rlc version 0.5.0 Index]