weight: Change Weights for stype Vector Elements

weightR Documentation

Change Weights for stype Vector Elements

Description

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.

Usage

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

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

## S4 method for signature '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.


novisci/stype documentation built on July 28, 2022, 7:44 a.m.