Hi! I've noticed the ecdf() R code (R ver. 2.5.0) contains two call to sort: --- [R-code] --- ecdf <- function(x) x <- sort(x) n <- length(x) if (n < 1) stop("'x' must have 1 or more non-missing values") vals <- sort(unique(x)) rval <- approxfun(vals, cumsum(tabulate(match(x, vals)))/n, method = "constant", yleft = 0, yright = 1, f = 0, ties = "ordered") class(rval) <- c("ecdf", "stepfun", class(rval)) attr(rval, "call") <- sys.call() rval --- [/R-code] ---
I think one of the two calls to sort can be removed, improving the performance. What do you think? Sincerely, -- Marco ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel