[R] Counting NA?

Ben Bolker ben at zoo.ufl.edu
Wed Oct 23 14:12:31 CEST 2002


   sum(is.na(data$S2))
  [is.na returns TRUE/FALSE, which can also be added up as 0/1 values]

  For your other question: see ?pt, ?pnorm (which will also give you 
information about qt, qnorm, the quantile functions)

  Or help.search("normal"), help.search("Student")

On Wed, 23 Oct 2002, Matej Cepl wrote:

> Hi,
> 
> how to do quickly equivalent of the following?
> 
> 	counter = 0
> 	for(i in 1:length(data$S2)) {
> 		if(!is.na(data$S2[i])) {
> 			counter = counter + 1
> 		}
> 	}
> 
> I have imagined something like length(x,na.rm=TRUE).
> 
> How can I get values usually taken from tables like z-score, 
> values of t distribution etc.? I could not find them among 
> values mentioned in info file.
> 
> Thanks,
> 
> Matej
> 
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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