Hi,

Teaching this year I was noticing that there seems to be an odd limitation in 
the IQR function.  It doesn't allow one to set the quantile type.  It seems to 
me an easy thing to fix.  The current function is…

IQR <- function (x, na.rm = FALSE)  diff(quantile(as.numeric(x), c(0.25, 0.75), 
na.rm = na.rm, names = FALSE))

I propose that it be changed to…

IQR <- function (x, ...)  diff(quantile(as.numeric(x), c(0.25, 0.75), names = 
FALSE, …))

The new version has exactly the same default behaviour but allows one to set 
all features of the quantile function from the IQR function.  A simple pointer 
in the docs to quantile, na.rm option, and maybe even mention of types 
(especially type 6 when teaching students hand calculations) would be all that 
would be needed.

Would this be a bad thing in any way?

John Christie
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to