Separates string data on whitespace and separating symbols into an array.
sx(s, ..., sep_symbols = ",|", strict = TRUE)
vector of values
string to parse
force later arguments to be set by name
characters to consider separators
logical, if TRUE throw exception on confusing input
Can throw exception on lack of explicit value separators, example: bc('"a""b"')
and non-matching portions.
Whitespace is normalized to spaces.
Suggested by Emil Erik Pula Bellamy Begtrup-Bright https://github.com/WinVector/wrapr/issues/15.
qc
, qe
, qae
, bquote
, bc
sx('1 2 "c", d') # returns c("1", "2", "c", "d")
sx('1 2 3') # returns c("1", "2", "3")
sx('1 2 "3"') # returns c("1", "2", "3")
sx('1,2|3.4') # returns c("1", "2", "3.4")
sx('01 02') # returns c("01", "02")
Run the code above in your browser using DataLab