[R] missing values
uleopold at science.uva.nl
Thu Jun 27 10:12:01 CEST 2002
David Barron wrote:
> Try tapply(lsk0t50$Pox2, lsk0t50$ProfN, sum,na.rm=TRUE)
I tried but some strange things happen. The columns after Pox2 change into
Pox2 and for some Nas I get now 0 as a result.
How can I apply the above command to avoid mixing columns. The imported file
was a tab seperated file.
> ----- Original Message -----
> From: "Ulrich Leopold" <uleopold at science.uva.nl>
> To: <r-help at stat.math.ethz.ch>
> Sent: Thursday, June 27, 2002 7:56 AM
> Subject: [R] missing values
>>how can I exclude the missing values in the following example:
>>tapply(lsk0t50$Pox2, lsk0t50$ProfN, sum)
>>tapply(lsk0t50$Pox2, lsk0t50$ProfN, sum, Fun=is.na(lsk0t50$Pox2))
>>But it returns a lot of missing values in the result. Instead the missing
>>values in the variable should not be taken into account. So that I get
>>a NA as result if there are only NAs for the corresponding factor.
>>Any idea how this can be achieved?
>>Ulrich Leopold MSc.
>>Department of Physical Geography
>>Institute for Biodiversity and Ecosystem Dynamics
>>Faculty of Science
>>University of Amsterdam
>>Nieuwe Achtergracht 166
>>Phone: +31-(0)20-525-7456 (7451 Secretary)
>>Email: uleopold at science.uva.nl
>>Check us also out at:
>>Netherlands Centre for Geo-ecological Research
>>r-help mailing list -- Read
>>Send "info", "help", or "[un]subscribe"
>>(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
Ulrich Leopold MSc.
Department of Physical Geography
Institute for Biodiversity and Ecosystem Dynamics
Faculty of Science
University of Amsterdam
Nieuwe Achtergracht 166
Phone: +31-(0)20-525-7456 (7451 Secretary)
Email: uleopold at science.uva.nl
Check us also out at:
Netherlands Centre for Geo-ecological Research
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