[R] Newbie needs a count() function

About this list Date view Thread view Subject view Author view Other groups

Subject: [R] Newbie needs a count() function
From: Art Salwin (salwin@mitretek.org)
Date: Wed 29 Mar 2000 - 05:41:26 EST


Message-ID: <38E10AE6.75B533CE@mitretek.org>

Is there a count() function in R that tells how many
elements of a vector meet a certain criterion? (Need it for
generating contour plots.)

Currently I use the somewhat cumbersome
count<-length(v[v<7]) to determine, for example, the number
of elements
in v that are <7. (Note that count<-length(x[v<7]) would
also work,
where x is *any* vector that has the same length as v.)

-- 
Art Salwin
salwin@mitretek.org
(202) 863-2985
(202) 863-2988 (fax)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Mon 17 Jul 2000 - 12:33:13 EST