Skip to content
Prev 28860 / 63424 Next

var/sd and NAs in R2.7.0

Oops, as I just realized, var does have a 'use' argument in 2.6.2, so I
can just use Gabor's suggestion for var. Sorry for that Gabor.

-----Original Message-----
From: McGehee, Robert 
Sent: Friday, May 16, 2008 11:20 AM
To: 'Gabor Grothendieck'
Cc: R-devel
Subject: RE: [Rd] var/sd and NAs in R2.7.0

I know I can get around this, I just would prefer that if R is breaking
backwards compatibility, then it's intentional (maybe it is, I just
don't know). That is, I don't want to require my entire company to
upgrade to 2.7.0 just so I can deploy a fix here, and I'd prefer not to
check the argument list of var every time I use it.

if ("use" %in% names(formals(var)))
	var(x, na.rm=TRUE, use="p")
else
	var(x, na.rm=TRUE)


-----Original Message-----
From: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] 
Sent: Friday, May 16, 2008 11:03 AM
To: McGehee, Robert
Cc: R-devel
Subject: Re: [Rd] var/sd and NAs in R2.7.0

Try

var(c(NA, NA, NA), use = "pairwise.complete.obs")


On Fri, May 16, 2008 at 10:56 AM, McGehee, Robert
<Robert.McGehee at geodecapital.com> wrote:
'sd'
file,
Anyway,
(like
error
fail
fo...{{dropped:11}}