% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/impute_missing.R
\name{impute_missforest}
\alias{impute_missforest}
\title{Impute missing values via random forest (missForest)}
\usage{
impute_missforest(data, ntree = 100, cols = NULL, verbose = FALSE, ...)
}
\arguments{
\item{data}{A data.frame or tibble containing missing values.}

\item{ntree}{Integer; number of trees to grow in each forest (passed to missForest). Default 100.}

\item{cols}{Optional character vector of numeric columns to impute.
Defaults to all numeric columns with at least one NA.}

\item{verbose}{Logical; if TRUE, prints progress and a completion summary. Default FALSE.}

\item{...}{Additional arguments passed to missForest::missForest().}
}
\value{
A data.frame/tibble with numeric columns imputed by missForest (or mean fallback).
}
\description{
Wraps missForest to impute numeric columns using non-parametric random forests.
Requires the missForest package to be installed (Suggests). Non-numeric columns
are untouched. If no numeric columns contain NAs, \code{data} is returned unchanged.
}
\details{
Notes:
\itemize{
\item missForest uses iterative RF training; it can be slow on wide/high-NA data.
\item Errors (e.g., insufficient unique values) are caught and a deterministic mean
imputation fallback is applied to the selected numeric columns.
}
}
\examples{
\donttest{
if (requireNamespace("missForest", quietly = TRUE)) {
  df <- tibble::tibble(a = c(1, NA, 3), b = c(2, 4, NA), c = 5)
  impute_missforest(df, ntree = 50, verbose = TRUE)
}
}

}
\references{
\insertRef{stekhoven2012missforest}{HealthMarkers}
}
