Skip to contents

Consecutive or overlapping integers separated by commas or semi-colons are summarised into a single integer range, non-consecutive integer ranges are kept as is.

Usage

summarise_integers(x, range_operator = "-", collapse = TRUE)

Arguments

x

vector of integers

range_operator

string to go between the starting and ending integer in the range, defaults to "-".

collapse

boolean to collapse all integer ranges into one comma separated string, defaults to TRUE.

Value

vector or single string of summarised integer ranges.