From 7f7ed0c4579e609dc1df6681316ccb218cfbae15 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 10 Nov 2021 16:49:26 +0000 Subject: [PATCH] avoid mixture of NA and NaN --- R/pairwise-comparisons.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/pairwise-comparisons.R b/R/pairwise-comparisons.R index 1f9d45a6d..e0b273c41 100644 --- a/R/pairwise-comparisons.R +++ b/R/pairwise-comparisons.R @@ -278,6 +278,8 @@ pairwise_comparison_one_group <- function(scores, by = "model"] # merge back to retain the ratios even for comparisons with the baseline result <- merge(result, result_without_baseline, all.x = TRUE) + # avoid mixture of NA and NaN which can cause problems downstream + result[is.na(theta), theta := NaN] # remove NAs form merge in the thetas result[, theta := unique(na.omit(theta)), by = "model"] } else {