Skip to content

Commit 854d23f

Browse files
committed
fix error when several NA indices
1 parent 852598f commit 854d23f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/expct.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ expct <- function(
251251
indices_na <- cparams$forest[is.na(f_idx), c_idx]
252252
indices_sampled <- cparams$forest[!is.na(f_idx), unique(c_idx)]
253253
rows_na <- dcast(rbind(data.table(c_idx = 0, variable = params$meta[,variable]),
254-
cparams$evidence_prepped[c_idx == indices_na,],
254+
cparams$evidence_prepped[c_idx %in% indices_na,],
255255
fill = T),
256256
c_idx ~ variable, value.var = "val")[c_idx != 0,]
257257
if (nomatch == "force") {

R/forge.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ forge <- function(
283283
indices_na <- cparams$forest[is.na(f_idx), c_idx]
284284
indices_sampled <- cparams$forest[!is.na(f_idx), unique(c_idx)]
285285
rows_na <- dcast(rbind(data.table(c_idx = 0, variable = params$meta[,variable]),
286-
cparams$evidence_prepped[c_idx == indices_na,],
286+
cparams$evidence_prepped[c_idx %in% indices_na,],
287287
fill = T),
288288
c_idx ~ variable, value.var = "val")[c_idx != 0,]
289289
rows_na <- rbindlist(replicate(n_synth, rows_na, simplify = FALSE))

0 commit comments

Comments
 (0)