Skip to content

check without loop

2 messages · Scott, Uriel, jimi adams

#
I think the which() function would be helpful.  For example if x is a vector
and c some value then
will return a vector of those indices i of x for which x[i] = c.  Then you
can test whether that vector
has length 0.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
thanks to all,
%in%
was what i was looking for

----- Original Message -----
From: "Scott, Uriel" <uriel.scott at mirant.com>
To: "'jimi adams'" <imij at columbus.rr.com>; <r-help at stat.math.ethz.ch>
Sent: Wednesday, March 20, 2002 1:45 PM
Subject: RE: [R] check without loop
vector
i
19
41
61
61
71
93
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._