[R] Counting NA?

Matej Cepl matej at ceplovi.cz
Wed Oct 23 16:52:49 CEST 2002

On Wed, Oct 23, 2002 at 01:54:50PM +0200, David Wartel wrote:
> Surely not the best method:
> length(which(is.na(data$S2)==TRUE))


I am sorry, of course, that I have found similar solution
("==TRUE" is unnecessary) five seconds after firing up
'sendmail -q'.  Thanks for the references to z-score,
t-distribution, etc., though.

One this I was really surprised what that in order to get data
from the same data I have to use following construct constantly:

	sumyes <- length(data$S2[data$S2 == 1 & !is.na(data$S2)])

Isn't there any way how to say R, that I want eliminate NA data 
for all my following calculations?


Matej Cepl, matej at ceplovi.cz, PGP ID# D96484AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
The politician attempts to remedy the evil by increasing the very
thing that caused the evil in the first place: legal plunder.
    -- Frederick Bastiat

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

More information about the R-help mailing list