hl_mat()
and hl_vec()
are identical functions which both work on
matrices and atomic vectors.
hl_mat(.data, colour, selection = NULL, elem = "fill", show_legend = FALSE)
hl_vec(.data, colour, selection = NULL, elem = "fill", show_legend = FALSE)
emphatic
matrix or atomic vector.
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()
.
specify the locations in the matrix which will be highlighted.
(default) Apply highlighting to all elements
Numeric vector of indices. e.g. c(1, 2, 3)
Either length 1, or a length which matches the
total number of elements in the matrix/vector e.g. TRUE
An expression which evaluates to a logical vector,
or vector of indices.
The matrix/vector itself can be referenced in these expressions
using the variable .x
E.g. abs(.x)> 0.5 & .x != 1
or row(.x) == 3
Apply the highlighting to the 'fill' (the background) or the 'text'. Default: 'fill'
if a scale object is used for colour, and show_legend = TRUE
,
then a colourbar legend will be added to the bottom of the output.
Default: FALSE