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)

Arguments

.data

emphatic matrix or atomic vector.

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/vector e.g. TRUE

expression

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

elem

Apply the highlighting to the 'fill' (the background) or the 'text'. Default: 'fill'

show_legend

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