Nothing
## like the 'ecdf' function but works with weights
## the xs must be unique! if they are not unique and you have equal weights
## use the standard 'ecdf' function.
getEcdf <-
function (x, w=1/length(x))
{
x <- sort.int(x, index.return=TRUE)
w <- w[x$ix]
x <- x$x
n <- length(x)
if (n < 1)
stop("'x' must have 1 or more non-missing values")
##vals <- unique(x)
rval <- approxfun(x, cumsum(w),
method = "constant", yleft = 0, yright = 1, f = 0,
ties = "ordered")
class(rval) <- c("ecdf", "stepfun", class(rval))
assign("nobs", n, envir = environment(rval))
attr(rval, "call") <- sys.call()
rval
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.