Nothing
agg.wtd.mean <- function(x, by, weights = NULL, na.rm = FALSE) {
if(is.null(weights)) weights <- rep(1, nrow(data.frame(x)))
res <- split(data.frame(weights,x), by)
if(ncol(res[[1]])==2) {
res <- data.frame(mean = sapply(res, function(z) stats::weighted.mean(z[,2], z[,1], na.rm = na.rm)))
} else {
res <- do.call("rbind.data.frame", args = lapply(res, function(z) sapply(z[,-1], stats::weighted.mean, w = z[,1], na.rm = na.rm)))
colnames(res) <- colnames(x)
rownames(res) <- levels(by)
}
return(res)
}
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.