To follow up, strapply has been added to the
gsubfn package (gsubfn 0.1-1) which should make it
easier to address this problem.
Its basically just a sapply call around gsubfn which
returns the transformed matches rather than performing
substitution. Its analogous to apply:
apply(object,
On 4/4/06, Bill Dunlap <[EMAIL PROTECTED]> wrote:
> On Tue, 4 Apr 2006, Gabor Grothendieck wrote:
>
> > gsubfn in package gsubfn can do this. See the examples
> > in ?gsubfn
>
> Thanks. gsubfn looks useful, but may be overkill
> for this, and it isn't vectorized. To do what
gsubfn is vectorized
On Tue, 4 Apr 2006, Gabor Grothendieck wrote:
> gsubfn in package gsubfn can do this. See the examples
> in ?gsubfn
Thanks. gsubfn looks useful, but may be overkill
for this, and it isn't vectorized. To do what
strsplit(keep=T) would do I think you need to do something like:
> findMatches<
gsubfn in package gsubfn can do this. See the examples
in ?gsubfn
On 4/4/06, Bill Dunlap <[EMAIL PROTECTED]> wrote:
> strsplit() is a convenient way to get a
> list of items from a string when you
> have a regular expression for what is not
> an item. E.g.,
>
> > strsplit("1.2, 34, 1.7e-2", s
strsplit() is a convenient way to get a
list of items from a string when you
have a regular expression for what is not
an item. E.g.,
> strsplit("1.2, 34, 1.7e-2", split="[ ,] *")
[[1]]:
[1] "1.2""34" "1.7e-2"
However, sometimes is it more convenient to
give a pattern for the it