[Rd] stats::median

Rob J Hyndman Rob.Hyndman at monash.edu
Wed Feb 15 11:48:56 CET 2017


The generic stats::median method is defined as
   median <- function (x, na.rm = FALSE)  {UseMethod("median")}

I suggest that this should become
   median <- function (x, na.rm = FALSE, ...)  {UseMethod("median")}

This would allow additional S3 methods to be developed with additional
arguments.

Currently I have to over-ride this generic definition in the
demography package because median.demogdata has several other
arguments.

This shouldn't break any code, and will make it easier for new S3
methods to be developed. It is also consistent with almost all other
S3 methods which do include an ellipsis.

-------------------------------------------------------------
Rob J Hyndman
Professor of Statistics, Monash University
www.robjhyndman.com



More information about the R-devel mailing list