impute_missing_values: Impute Missing Values

View source: R/impute_missing_values.R

impute_missing_valuesR Documentation

Impute Missing Values

Description

Impute any missing values from selected columns within a data.frame

Usage

impute_missing_values(
  data_df = NULL,
  col_nm_vec = NULL,
  method = c("randomForestSRC", "missForest", "Hmisc"),
  my_seed = 5,
  ntree = 1000,
  nk = 4,
  ...
)

Arguments

data_df

data.frame with potential missing values

col_nm_vec

character vector of column names that should be either imputed and/or used to impute other columns

method

which method to use, either by creating random forests using the missForest package, or by predictive mean matching using the aregImpute() function in the Hmisc package

my_seed

seed for random number generator, to make results reproducible

ntree

how many trees to build if missForest or randomForestSRC

nk

how many knots to use in smoothing splines if using method = 'Hmisc'

...

other arguments to be passed to either missForest::missForest(), Hmisc::aregImpute(), or randomForestSRC::impute() functions

Value

a data.frame with the same dimensions as the original, but with no missing values

Author(s)

Kevin see


mackerman44/DASH documentation built on Sept. 5, 2024, 8:14 a.m.