Re: [R] strsplit, keeping delimiters

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sat, 14 Jun 2008 09:22:29 -0500

On Sat, Jun 14, 2008 at 12:55 AM, Gabor Grothendieck <ggrothendieck_at_gmail.com> wrote:
> Try this:
>
>> library(gsubfn)
>> x <- "A: 123 B: 456 C: 678"
>> strapply(x, "[^ :]+[ :]|[^ :]+$")
> [[1]]
> [1] "A:" "123 " "B:" "456 " "C:" "678"
>
> and check out the gsubfn home page at:
>
> http://gsubfn.googlecode.com

Thanks Gabor!
Hadley

-- 
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 14 Jun 2008 - 14:32:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 14 Jun 2008 - 16:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive