Skip to content

Commit

Permalink
Update xgboostImpute.R - fix bug in input check when using objective
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkowa committed Jun 13, 2024
1 parent 627672a commit c5ada60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/xgboostImpute.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ xgboostImpute <- function(formula, data, imp_var = TRUE,
rhs_na <- apply(subset(data, select = rhs2), 1, function(x) any(is.na(x)))
#objective should be a vector of lenght equal to the lhs variables
if(!is.null(objective)){
stopifnot(length(objective)!=length(lhs))
stopifnot(length(objective)==length(lhs))
}
for (lhsV in lhs) {
form <- as.formula(paste(lhsV, "~", rhs,"-1"))
Expand Down

0 comments on commit c5ada60

Please sign in to comment.