| To: | <stephane.g.zebouni@jpmorgan.com>, <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: small question about NA |
| From: | "Stewart, William" <william.stewart@rbc.com> |
| Date: | Fri, 19 Aug 2005 10:16:36 -0400 |
| Thread-index: | AcWkxxdugyrCL1BIQVyUPvILMFHuSgAAVMTw |
| Thread-topic: | [S] small question about NA |
|
The
easiest way I can think of is to use subscripting to exclude NA objects
(implicitly treating them as zero in the sum). For example:
test <- c(1,2,3,4,NA,6,7,8,9) sum(test[!is.na(test)]) -------------------------
__________________________________________________________________________________________________________________________________ This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | small question about NA, stephane . g . zebouni |
|---|---|
| Next by Date: | Re: small question about NA, Patrick Burns |
| Previous by Thread: | Re: small question about NA, Patrick Burns |
| Next by Thread: | Re: small question about NA, stephane . g . zebouni |
| Indexes: | [Date] [Thread] [Top] [All Lists] |