?setdiff
e.g.,
> txt <- c("arm","foot","lefroo", "bafoobar")
> i <- grep("foo",txt); i
[1] 2 4
> setdiff(seq(length(txt)),grep("foo",txt))
[1] 1 3
>
Jim
__________________________________________________________
James Holtman "What is the problem you are trying to solve?"
Executive Technical Consultant -- Convergys Labs
[EMAIL PROTECTED]
+1 (513) 723-2929
Marcus Leinweber
<[EMAIL PROTECTED]> To:
"'r-help@stat.math.ethz.ch'" <r-help@stat.math.ethz.ch>
Sent by: cc:
[EMAIL PROTECTED] Subject: [R] grep negation
ath.ethz.ch
06/23/2005 08:59
hi,
using the example in the grep help:
txt <- c("arm","foot","lefroo", "bafoobar")
i <- grep("foo",txt); i
[1] 2 4
but how can i get the negation (1,3) when looking for 'foo'?
thanks,
m.
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html