From 9b1e261fcdef38bb0aa5bf6145d2600a40648ae8 Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Fri, 21 Feb 2025 15:15:16 +0100 Subject: [PATCH] split data.frame without forcing it into data.table --- R/impute.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/impute.R b/R/impute.R index 1fd4a2fd..7029ff23 100644 --- a/R/impute.R +++ b/R/impute.R @@ -114,10 +114,7 @@ impute <- function(x, evidence = list(x), round = list(round), forge_args)) - x_synth <- as.data.table(x_synth) - x_synth[, idx := rep(1:m, nrow(x))] - x_imputed <- split(x_synth, by = "idx") - x_imputed <- lapply(x_imputed, function(x) x[, idx := NULL]) + x_imputed <- split(x_synth, rep(1:m, nrow(x))) } x_imputed }