powered by
weighted.tabulate() returns the sum of weights for each integer in the vector bin.
weighted.tabulate()
bin
weighted.tabulate(bin, w = NULL, nbins = max(1L, bin, na.rm = TRUE))
weighted.tabulate() returns an numeric vector.
a numeric vector of positive integers, or a factor.
a numeric vector of the sample weights for each value in bin.
the number of bins to be used.
weighted.tabulate() is a wrapper function of tabulate() to reflect sample weights.
tabulate()
tabulate(bin = c(2, 2, 3, 5)) weighted.tabulate(bin = c(2, 2, 3, 5), w = 1:4)
Run the code above in your browser using DataLab