[R] grep() exclude certain patterns?

Greg Snow Greg.Snow at imail.org
Fri Dec 4 21:35:28 CET 2009


The invert argument seems a likely candidate, you could also do perl=TRUE and use negations within the pattern (but that is probably overkill for your original question).


Could you explain to us the process that you use to search for answers to your questions before posting?  You have been asking quite a few questions that have answers out there if you can find them.  If you tell us where you are looking (and why) then we may be able to suggest some different search strategies that will help you find the answers quicker.  Also knowing your thought process may help us in designing future help/tutorials that cater more to people learning R for the first time, things that seem obvious to those of us who have been using the current documentation, apparently are not that obvious to some new users (but also realize that the first place that you may think to look may not even occur to some of us that learned computers in a different time, see fortune(89) ).


-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Peng Yu
> Sent: Friday, December 04, 2009 12:43 PM
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] grep() exclude certain patterns?
> 
> On Fri, Dec 4, 2009 at 11:54 AM, Duncan Murdoch <murdoch at stats.uwo.ca>
> wrote:
> > On 04/12/2009 12:52 PM, Peng Yu wrote:
> >>
> >> The external grep program has an option -v to select non-matching
> >> lines. I'm wondering if how to exclude certain patterns in grep() in
> >> R?
> >>
> >
> > ?grep
> 
> I don't see which argument to use.
> 
> ______________________________________________
> 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.




More information about the R-help mailing list