[R] Regexp question

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 17 21:12:12 CET 2010


On Wed, Nov 17, 2010 at 2:59 PM, johannes rara <johannesraja at gmail.com> wrote:
> I have a vector like this:
>
> a <- c("thisIsName", "thisIsAlsoName", "andThisName")
>
> How to break this into pieces and produce a vector with unique parts:
>
> this
> Is
> Name
> Also
> and
> This

Try this:

library(gsubfn)
strapply(a, ".[[:lower:]]*")

See http://gsubfn.googlecode.com for more.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list