Skip to content

Commit

Permalink
split data.frame without forcing it into data.table
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwright committed Feb 21, 2025
1 parent ad6fd47 commit 9b1e261
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions R/impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 9b1e261

Please sign in to comment.