toRangeStr: Convert a numerical vector into a range string.

Description Usage Arguments Value Examples

View source: R/toRangeStr.R

Description

Convert a numerical vector into a range string.

Usage

1
toRangeStr(x, range.sep = " - ", block.sep = ", ")

Arguments

x

[integer]
Vector to convert into a range string.

range.sep

[character(1)]
Separator between the first and last element of a range of consecutive elements in x. Default is “ - ”.

block.sep

[character(1)]
Separator between non consecutive elements of x or ranges. Default is “, ”.

Value

[character(1)]

Examples

1
2
x = sample(1:10, 7)
toRangeStr(x)

berndbischl/BBmisc documentation built on Nov. 29, 2017, 5:10 a.m.