Skip to content
Back to formatted view

Raw Message

Message-ID: <x24rru150l.fsf@blueberry.kubism.ku.dk>
Date: 2001-07-30T21:27:54Z
From: Peter Dalgaard
Subject: functions, `...' and .Rprofile
In-Reply-To: mmiller3@iupui.edu's message of "30 Jul 2001 15:01:26 -0500"

mmiller3 at iupui.edu (Michael A. Miller) writes:

> I'm experiencing some confusion with the ellipsis argument
> (...).  
> 
> In my .Rprofile, I have the following functions:
> 
>    stderr <- function(x, ...) {
>      sqrt( var(x, ...) / length(x) )
>    }
>    se <- stderr
...
> If I use stderr instead, I don't get that error:
> 
>    > tapply( Diameter, factor(Region), stderr, na.rm=TRUE )
>              I          II         III          IV           V 
>    0.005167949 0.004405095 0.006588870 0.006633189 0.001857812 

I know that's not what you were asking, but you're not getting
the correct result either... You'd need to divide by sum(!is.na(x))
rather than length(x).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._