Highlight elements by location within an emphatic data.frame or matrix.

hl_loc(
  .data,
  colour,
  row_ids,
  col_ids,
  elem = "fill",
  major = "row",
  expand_grid = TRUE
)

Arguments

.data

emphatic data.frame or 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().

row_ids, col_ids

numeric indices of which rows and columns to highlight

elem

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

major

which is the direction in which to first replicate colours? i.e. should colour be replicated to match the number of rows first, or the number of columns? Default: 'row'. Possible values: 'row', 'column'

expand_grid

How should the vectors of row and column indices be combined to create location coorinates? If expand_grid = TRUE (the default) then a full outer join is done on rows and cols using expand.grid() - this means that all possible combinations of the specified rows and columns will be highlighted. Otherwise the locations are created using a simpler call to cbind().