Skip to content

Commit

Permalink
avoid mixture of NA and NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk authored Nov 10, 2021
1 parent bb55042 commit 7f7ed0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/pairwise-comparisons.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7f7ed0c

Please sign in to comment.