Skip to contents

Given a vector, returns the indices (and an adjustment to draw lines between cells) where the value is not equal to the preceding value. Main use intended to be in row.lines arguments to create.heatmap

Usage

get.line.breaks(
  x
  );

Arguments

x

A vector, numeric, factor or character.

Value

A vector of integers representing the break points in the vector x

Author

Nicholas Harding

Examples

set.seed(12345);
values <- sample(
  default.colours(3),
  20,
  replace = TRUE
  );
get.line.breaks(values);
#>  [1]  1.5  2.5  4.5  5.5  6.5  8.5  9.5 10.5 11.5 13.5 14.5 15.5 17.5 18.5 19.5