agg.wtd.var.RdSplits the data into subsets (according to the levels of a factor) and computes the weighted variance for each
agg.wtd.var(x, by, weights = NULL, na.rm = FALSE)numeric vector or data frame of numeric vectors
factor used to split the data
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE.
a data frame