Return a stype vector where the elements are weighted according to the specified inputs. By default, all of the weights for a stype vector are effectively constant.

weight(x, w, .descriptors = list())

# S4 method for stype,stypeWeightVar,maybeDescriptor
weight(x, w, .descriptors = list())

# S4 method for stype,weightVar,maybeDescriptor
weight(x, w, .descriptors = list())

Arguments

x

a vector a values

w

a vector of weights (optional)

.descriptors

an optional list of functions. Each function should have a signature of the form function(v, ...), and where v is expected to be of the result of calling as_canonical(x) on the x input to describe, and ... is expected to be the unchanged value of the input to ... in describe. If the input list is named then elements in the return object corresponding to the result of evaluating the supplied functions will have the corresponding names.