R/utils.R
weight_assign.Rd
assign values by weight
weight_assign(x, w, list = FALSE)
A numeric value
A weight vector
(optional) Return list or not. if list is TRUE, return a list, otherwise return a vector. Default is FALSE.
list
TRUE
FALSE
A numeric Vector.
weight_assign(0.875,1:3) #> [1] 0.1458333 0.2916667 0.4375000