freeze_na_proportion | R Documentation |
This function adds an additional level to any target variable to represent missing data. The proportion given to the missing data is the proportion missing in the observed sample. Other proportions are adjusted accordingly. This is a private function and not intended for end-user use.
freeze_na_proportion(data, target, which_vars)
data |
A data frame (tibble) or matrix containing sample data,
specified as in |
target |
A list of named vectors, specified as in |
which_vars |
A boolean, numeric, or character vector specifying which variables to adjust in this manner. If boolean, all variables are selected. If character, those named variables are selected. If numeric, variables are selected based on numeric position amongst the target variables. |
An augmented target list, where affected variables with observed missing data in the sample has an additional level named "___NA" reflecting the proportion of data missing in the sample and other levels are adjusted accordingly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.