Re: [R] strsplit with a vector split argument

2013-09-18 Thread arun
Hi, You could try: strsplit(c("a,b;c","d;e,f"),",|;") #[[1]] #[1] "a" "b" "c" # #[[2]] #[1] "d" "e" "f" A.K. - Original Message - From: Sam Steingold To: r-help@r-project.org Cc: Sent: Wednes

Re: [R] strsplit with a vector split argument

2013-09-18 Thread Hervé Pagès
er a|b|c|d|e. It's also more compact and easier to read. H. #[[1]] #[1] "a" "b" "c" # #[[2]] #[1] "d" "e" "f" A.K. - Original Message - From: Sam Steingold To: r-help@r-project.org Cc: Sent: Wednesday, September 18, 2

Re: [R] strsplit with a vector split argument

2013-09-18 Thread Marc Schwartz
On Sep 18, 2013, at 10:42 AM, Sam Steingold wrote: > Hi, > I find this behavior unexpected: > --8<---cut here---start->8--- >> strsplit(c("a,b;c","d;e,f"),c(",",";")) > [[1]] > [1] "a" "b;c" > > [[2]] > [1] "d" "e,f" > --8<---cut here--

[R] strsplit with a vector split argument

2013-09-18 Thread Sam Steingold
Hi, I find this behavior unexpected: --8<---cut here---start->8--- > strsplit(c("a,b;c","d;e,f"),c(",",";")) [[1]] [1] "a" "b;c" [[2]] [1] "d" "e,f" --8<---cut here---end--->8--- I thought that it should be identical to th