Skip to content

Commit

Permalink
fix #96
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Oct 22, 2024
1 parent e336c03 commit c5e4f3a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: oolong
Title: Create Validation Tests for Automated Content Analysis
Version: 0.6.1
Version: 0.6.2
Authors@R:
c(person(given = "Chung-hong", family = "Chan", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-6232-7530")),
person(given = "Marius", family = "Sältzer", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0002-8604-4666")))
Expand All @@ -19,7 +19,7 @@ Imports:
digest,
R6,
quanteda (>= 3.0.0),
irr,
icr,
ggplot2,
cowplot,
cli,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# oolong 0.6.2 (development)

* Add content for MH
* Use `icr` for the calculation of Krippendorff's Alpha

# oolong 0.6.1

Expand Down
4 changes: 2 additions & 2 deletions R/oolong_summary_gs.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.minmax <- function(x) {
(x - min(x)) / (max(x) - min(x))
(x - min(x)) / (max(x) - min(x))
}

.corr_plot <- function(answers, target_value) {
Expand Down Expand Up @@ -37,7 +37,7 @@
avg_answer <- apply(answers, 1, mean)
answers$avg_answer <- avg_answer
if (length(obj_list) > 1) {
kripp <- irr::kripp.alpha(t(as.matrix(answers[,grepl("^answer", colnames(answers))])), method = "ordinal")
kripp <- icr::krippalpha(t(as.matrix(answers[,grepl("^answer", colnames(answers))])), metric = "ordinal")
} else {
kripp <- NA
}
Expand Down
4 changes: 2 additions & 2 deletions R/oolong_summary_tm.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
res$multiple_test <- NA
res$rater_precision_p_value <- NA
} else {
res$kripp_alpha <- irr::kripp.alpha(t(ifelse(correction_matrix, 2, 1)))$value
res$kripp_alpha <- icr::krippalpha(t(ifelse(correction_matrix, 2, 1)))$alpha
res$multiple_test <- purrr::map(n_correct, ~binom.test(., n = nrow(correction_matrix), p = 1/n_choices, alternative = "greater"))
res$rater_precision_p_value <- .combine_p_fisher(purrr::map_dbl(res$multiple_test, "p.value"))
}
Expand Down Expand Up @@ -90,7 +90,7 @@
if (length(obj_list) == 1) {
res$kripp_alpha_wsi <- NA
} else {
res$kripp_alpha_wsi <- irr::kripp.alpha(t(ifelse(correction_matrix, 2, 1)))$value
res$kripp_alpha_wsi <- icr::krippalpha(t(ifelse(correction_matrix, 2, 1)))$alpha
}
}
return(res)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/printing.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
i Mean model precision: 0.833333333333333
i K Precision:
0.3, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1, 1
i Krippendorff's alpha: 0.056
i Krippendorff's alpha: 0.072

---

Expand Down

0 comments on commit c5e4f3a

Please sign in to comment.