powered by
Convert a numerical vector into a range string.
toRangeStr(x, range.sep = " - ", block.sep = ", ")
[character(1)]
character(1)
[integer] Vector to convert into a range string.
integer
[character(1)] Separator between the first and last element of a range of consecutive elements in x. Default is “ - ”.
x
[character(1)] Separator between non consecutive elements of x or ranges. Default is “, ”.
x = sample(1:10, 7) toRangeStr(x)
Run the code above in your browser using DataLab