Is there any package to handle missing values in R?

My question is very obvious: Is there any package to handle missing values in R?

I think this task can be done almost in an automatic way. I mean, we can have a function like the one below which is simply a quick pseudo function:

handle_missing_values(
  dataframe,
  threshold_remove_variable: 40% # remove the variable when the missing value amount is greater or equal than 40%
  default_imputation_numeric_variables: "mean",
  default_imputation_categoric_variables: "Not Specified",
  imputation_numeric_variables: c(
    field5: "knn",
    field8: "prediction"
  ),
  imputation_categoric_variables: c(
    field2: "Not Asked"
  ),
  remove_rows_with_missing_values_at_the_end: true
)

Thanks in advance!

There is a whole task view on the topic: CRAN Task View: Missing Data.

1 Like

Hi, I've ever used mice package to handle missing value, but I'm not sure if this can execute all the commands above.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.