powered by
(stable)
Parse Text Into Numeric Vectors
parse_svec(text, sep = ",", connect = "-:|", sort = FALSE, unique = TRUE)
string with chunks, e.g. "1-10, 14, 16-20, 18-30" has 4 chunks
"1-10, 14, 16-20, 18-30"
default is ",", character used to separate chunks
characters defining connection links for example "1:10" is the same as "1-10"
sort the result
extract unique elements
a numeric vector. For example, "1-3" returns c(1, 2, 3)
c(1, 2, 3)
deparse_svec
# NOT RUN { parse_svec('1-10, 13:15,14-20') # }
Run the code above in your browser using DataLab