update_na_values: Internal copy of data to overwrite missing data

View source: R/augment_nas.R

update_na_valuesR Documentation

Internal copy of data to overwrite missing data

Description

This function replaces NAs in any columns in order to allow for the strategy described in freeze_na_proportion. NA values are replaced with "___NA". No modifications done this way are saved and data returned by harvest if attach_weights=TRUE will not be modified. This is a private function and not intended for end-user use.

Usage

update_na_values(data, target, which_vars)

Arguments

data

A data frame (tibble) or matrix containing sample data, specified as in harvest

target

A list of named vectors, specified as in harvest

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.

Value

An augmented version of data with NAs of affected variables replaced with "___NA", and the columns subset to those in target


aaronrudkin/autumn documentation built on Feb. 5, 2024, 6:08 p.m.