Skip to content

Commit

Permalink
fixed the data.table indexing passed to impute
Browse files Browse the repository at this point in the history
  • Loading branch information
blind-contours committed Oct 4, 2023
1 parent 7433178 commit b75abeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/process_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ process_data <- function(data, nodes, column_names, flag = TRUE,
nodes$covariates <- c(nodes$covariates, missing_indicator_vars)
}
# impute covariates
imputed <- impute(data[, missing_covar_cols, with = FALSE])
data_missing_covars <- data[, missing_covar_cols, with = FALSE]
imputed <- impute(data.frame(data_missing_covars))

# update data
set(data, , missing_covar_cols, imputed)
Expand Down

0 comments on commit b75abeb

Please sign in to comment.