[R] Not-In operator

Phil Spector spector at stat.berkeley.edu
Mon Jun 28 22:53:10 CEST 2010


Colton -
    Have you looked at the invert= argument of grep()?
(In regular expressions, ^ means "beginning of string",
and ! has no special meaning.)

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu


On Mon, 28 Jun 2010, Colton Hunt wrote:

> I would like to use grep to return all the lines of a data frame that do not
> contain the letters HD. I have tried the ^ inside brackets as well as !. The
> data frame is one column consisting of spaces,numbers, and letters with
> several thousand rows.
> Thank you!
> Colton
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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