Both of the following should return NA,
but do not in "R version 2.11.0 Under
development (unstable) (2010-03-07 r51225)"
on 32-bit Windows:

  > mean(c(1,10,100,NA), trim=.1)
  Error in sort.int(x, partial = unique(c(lo, hi))) : 
    index 4 outside bounds
  > mean(c(1,10,100,NA), trim=.26)
  [1] 55

With na.rm=TRUE they give the correct results.
(mean() would be so much simpler if we didn't
have to worry about the seldom-used trim=
argument.)

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to