Description Usage Arguments Value Examples
View source: R/helper_functions.R
This function calculates weights for a set of users, based on predefined targets
1  | calc_weights(df, y, min.cap = -Inf, max.cap = Inf)
 | 
df | 
 A dataframe containing metric values  | 
y | 
 A df that contains quotas (i.e. targets) that will be used to determine weights  | 
min | 
 Lower cap weight floor. Defaults to -Inf  | 
max | 
 Upper cap weight ceiling. Defaults to Inf  | 
A list object containing the input df with weights attached, and proportions for each variable used
1 2 3  | targets <- calc_props(df.test, 'user_id')
df.list <- calc_weights(df.control, targets)
df.weighted <- df.list$df
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.