Message-ID: <3EAD1060.8010309@lancaster.ac.uk>
Date: 2003-04-28T11:28:32Z
From: Barry Rowlingson
Subject: sum(..., na.rm=TRUE) oddity
In-Reply-To: <3EAD01FB.4000407@agric.uwa.edu.au>
rohan sadler wrote:
> Okay,
>
> This is one of the cases where I can answer my own foolishness. If I
> don't define the switch as na.rm=TRUE, but instead just as TRUE - which
> is my usual practice with other functions - then sum counts the TRUE as
> another vector object, and counts it as one. So much for saving keystrokes.
Are you certain you typed 'na.rm'? I have occasionally typed 'rm.na'
instead, and something like that might explain things:
> sum(1,1,na.rm=TRUE)
[1] 2
> sum(1,1,rm.na=TRUE)
[1] 3
Baz