From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Fri Dec 19 10:32:13 2008
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Fri, 19 Dec 2008 10:32:13 +0100
Subject: [Rd] gregexpr - match overlap mishandled (PR#13391)
In-Reply-To: <alpine.LFD.2.00.0812121910370.23680@gannet.stats.ox.ac.uk>
References: <20081212170504.93484282EFC1@mail.pubhealth.ku.dk>
	<alpine.LFD.2.00.0812121910370.23680@gannet.stats.ox.ac.uk>
Message-ID: <494B6A1D.80000@idi.ntnu.no>

Prof Brian Ripley wrote:
> Please do your own homework: the help page says
>
>      For 'gregexpr' a list of the same length as 'text' each element of
>      which is an integer vector as in 'regexpr', except that the
>      starting positions of every (disjoint) match are given.
>                                   ^^^^^^^^
>
> If that is still not clear enough for you, please ask your supervisor
> for remedial help.
>

i must say that even knowing what is meant i have trouble finding it
written in the docs.  someone who's looking for help because he does not
know the answer yet will most certainly get confused here.

the point is that gregexpr returns the starting positions of *mutually
non-overlapping*, or *pairwise disjoint* matches (which still does not
tell the whole story).  the expression 'every (disjoint) match' is
nonsense, as it suggests that only those matches which are individually
disjoint (and what would this mean?) are reported, as if of all possible
matches found only those that pass some disjointness test in a grep-like
filter were left.

i'd humbly suggest that once users are referred to specific man pages,
those pages are reassessed and improved where necessary -- this one
would be a good candidate.

vQ



[Rd] gregexpr - match overlap mishandled (PR#13391)
Wacek Kusnierczyk