parseRange: Parse range string

Description Usage Arguments Value Examples

Description

As with printer page ranges, sometimes you need to process a range. This is usually of years. A user may specify that they want 2000, 2002 and 2005-2008.

Usage

1
parseRange(range, sep = ", *", rsep = " *- *")

Arguments

range

character. By default, a character vector with dashes to delineate ranges and commas to separate them

sep

character Regular expression to for range separator

rsep

character Regular expression for range delineator

Value

character vector of numbers

Examples

1
2
3
4
5
parseRange("5, 7-9, 11")
# [1] "5"  "7"  "8"  "9"  "11"

parseRange("2*3;0", sep = "; *", rsep = "\\* *")
# [1] "2" "3" "0"

SWS-Methodology/faoswsUtil documentation built on May 9, 2019, 11:53 a.m.