Skip to content

Commit

Permalink
Merge pull request #563 from edbonneville/passing_args_ranger
Browse files Browse the repository at this point in the history
Pass extra arguments mice.impute.rf() to ranger::ranger()
  • Loading branch information
stefvanbuuren committed Jul 19, 2023
2 parents 3f43b9a + f1c697b commit 87073f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/mice.impute.rf.R
Expand Up @@ -10,8 +10,8 @@
#' alternative currently implemented is the \code{randomForest} package, which
#' used to be the default in mice 3.13.10 and earlier.
#' @param \dots Other named arguments passed down to
#' \code{mice:::install.on.demand()}, \code{randomForest::randomForest()} and
#' \code{randomForest:::randomForest.default()}.
#' \code{mice:::install.on.demand()}, \code{randomForest::randomForest()},
#' \code{randomForest:::randomForest.default()}, and \code{ranger::ranger()}.
#' @return Vector with imputed data, same type as \code{y}, and of length
#' \code{sum(wy)}
#' @details
Expand Down Expand Up @@ -106,7 +106,7 @@ mice.impute.rf <- function(y, ry, x, wy = NULL, ntree = 10,
install.on.demand("ranger", ...)

# Fit all trees at once
fit <- ranger::ranger(x = xobs, y = yobs, num.trees = ntree)
fit <- suppressWarnings(ranger::ranger(x = xobs, y = yobs, num.trees = ntree, ...))

nodes <- predict(
object = fit, data = rbind(xobs, xmis),
Expand Down
4 changes: 2 additions & 2 deletions man/mice.impute.rf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87073f8

Please sign in to comment.