expand_numeric: Expands a range of integers into all the integers it contains

Description Usage Arguments Value Examples

Description

Expands a range of integers into all the integers it contains

Usage

1

Arguments

x

A character vector containing condensed ranges of numbers; "a-b" or "a - b".

sep

The character separating the integers for output. Defaults to 'NULL', which will return a list of integer vectors.

replace

Controls if the expanded range is extracted into a list ('FALSE') or replaced within the strings ('TRUE)')

Value

Either a list of character vectors (if 'replace == FALSE') or a character vector similar to the input vector.

Examples

1
2
`expand_numeric("Precincts 1-5")`
`expand_numeric("Precincts 1-5,7-9", replace = TRUE)`

jayleetx/expandr documentation built on May 26, 2019, 4:39 p.m.