Highlight elements of a matrix
hl_matrix(.data, colour, selection = NULL, elem = "fill")
Arguments
.data |
emphatic matrix |
colour |
colour to use for highlighting. This may be an R colour,
a vector of R colours, or
a ggplot2 style "Scale" object e.g. scale_colour_continuous() . |
selection |
specify the locations in the matrix which will be highlighted.
- NULL
(default) Apply highlighting to all elements
- numeric vector
Numeric vector of indices. e.g. c(1, 2, 3)
- logical vector
Either length 1, or a length which matches the
total number of elements in the matrix. e.g. TRUE
- expression
An expression which evaluates to a logical vector,
or vector of indices.
The matrix itself can be referenced in these expressions
using the variable .x
E.g. abs(.x)> 0.5 & .x != 1 or row(.x) == 3
|
elem |
Apply the highlighting to the 'fill' (the background) or the 'text'.
Default: 'fill' |