Skip to contents

Takes a character vector containing a number range (e.g. "11 - 14") and replaces the range with the numbers contained in the range ("11 12 13 14").

Usage

rangeToVector(numbers, separator = " ")

Arguments

numbers

Character vector containing a number range indicated by a dash (e.g. "123 - 456")

separator

Character string to use as a separator between numbers

Value

The same character vector, but with number ranges removed and replaced with the numbers in the range explicitly listed.

Examples

rangeToVector("1 3 5-8 10")
#> [1] "1 3 5 6 7 8 10"