parse_svec: Parse Text Into Numeric Vectors (stable)

Description Usage Arguments Value See Also Examples

View source: R/strings.R

Description

Parse Text Into Numeric Vectors

(stable)

Usage

1
parse_svec(text, sep = ",", connect = "-:|", sort = FALSE, unique = TRUE)

Arguments

text

string with chunks, e.g. "1-10, 14, 16-20, 18-30" has 4 chunks

sep

default is ",", character used to separate chunks

connect

characters defining connection links for example "1:10" is the same as "1-10"

sort

sort the result

unique

extract unique elements

Value

a numeric vector. For example, "1-3" returns c(1, 2, 3)

See Also

deparse_svec

Examples

1
parse_svec('1-10, 13:15,14-20')

dipsaus documentation built on Sept. 6, 2021, 5:08 p.m.