On 02/10/2016 17:54, Pi wrote:> Hello.
>
> It would be great if the grep function in R had the option to use the -m
> parameter as the linux command does.
I guess you mean the non-standard flag of the GNU version of grep
(probably but not necessarily as used by Linux).
That the POSIX standard for grep does not have this (nor any other
commonly used implementation I am aware of) indicates that your
enthusiasm for this is not shared by grep experts.
> That would allow to stop a grep search as soon as something is found.
> It would make many operations much faster.
Those who would have to do the work to implement this will not be taking
your word for that, but would expect convincing examples of real
problems where it was so and grep was the bottleneck.
Your 'case' seems to be for a shortcut for any(grepl()) along the lines
of anyDuplicated().
> [[alternative HTML version deleted]]
This is a non-HTML list, as the posting guide told you. And using a
real name adds credibility.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford