Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/common-events.R
A selection mode is essentially a logical operation like AND, OR, and XOR, etc.
1 | mode_selection(x, y, mode = "none")
|
x |
logical: the previous selection status |
y |
logical: the current selection status (if |
mode |
the selection mode string; see Details |
There are five selection modes:
ignore previous selection and completely start over again
select the intersection, i.e. the objects that are selected by two successive brushing operations
select the union, i.e. any objects selected by all previous operations and the current operation
toggle the selection
negation, i.e. exclude the objects under two successive brushing operations
the complement of the current selection
We can hold the key while brushing: A for 'and', O for 'or', X for 'xor', N for 'not' and C for 'complement'.
a logical vector indicating whether the objects are selected
Yihui Xie <http://yihui.name>
1 2 3 4 5 6 7 8 9 10 | x1 <- c(TRUE, TRUE, FALSE, FALSE)
x2 <- c(FALSE, TRUE, TRUE, FALSE)
mode_selection(x1, x2, "none")
mode_selection(x1, x2, "and")
mode_selection(x1, x2, "or")
mode_selection(x1, x2, "xor")
mode_selection(x1, x2, "not")
mode_selection(x1, x2, "complement")
mode_selection(x1, c(2, 3), "and") # equivalent to x2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.