Sounds like
sum(x, na.rm=TRUE)
will do what you want.
Patrick Burns
patrick@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
stephane.g.zebouni@jpmorgan.com wrote:
Hi,
I am using S-plus 6.1. I am making sums of vectors where no value (NA)
can occur and I want to consider those values as 0 - is there an easy
way to do that?
thanks a lot in advance
Stephane Zebouni
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
|