Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toRangeStr

Convert a numerical vector into a range string.


Description

Convert a numerical vector into a range string.

Usage

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

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

BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.