These functions weight the variable x
by
a specific vector of weights
.
1 2 3 
x 
(Unweighted) variable 
weights 
Vector with same length as 
digits 
Numeric value indicating the number of decimal places to be
used for rounding the weighted values. By default, this value is

weight2()
sums up all weights
values of the associated
categories of x
, whereas weight()
uses a
xtabs
formula to weight cases. Thus, weight()
may return a vector of different length than x
.
The weighted x
.
The values of the returned vector are in sorted order, whereas the values'
order of the original x
may be spread randomly. Hence, x
can't be
used, for instance, for further cross tabulation. In case you want to have
weighted contingency tables or (grouped) box plots etc., use the weightBy
argument of most functions.
1 2 3 4 5 6 7 8 9 10 11 12 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.