Fix comparison type check in R-devel
making sure the bang bang operator is applied.
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
Error in `as.name(thresholdScore) >= threshold`: comparison (>=) is
not possible for language types
Backtrace:
▆
1. ├─testthat::expect_warning(...) at test-collocations.R:19:5
2. │ └─testthat:::quasi_capture(...) at
testthat/R/expect-condition.R:170:5
3. │ ├─testthat (local) .capture(...) at
testthat/R/quasi-label.R:54:3
4. │ │ └─base::withCallingHandlers(...) at
testthat/R/deprec-condition.R:102:3
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) at
testthat/R/quasi-label.R:54:3
6. ├─RKorAPClient::collocationAnalysis(...) at rlang/R/eval.R:96:3
7. └─RKorAPClient::collocationAnalysis(...) at
RKorAPClient/R/collocationAnalysis.R:1:35
8. └─RKorAPClient (local) .local(kco, ...)
Change-Id: I5f3984376e4a6b01ba9ae03d8ef3e684284be4ef
diff --git a/R/collocationAnalysis.R b/R/collocationAnalysis.R
index 64e0c83..fc96f1c 100644
--- a/R/collocationAnalysis.R
+++ b/R/collocationAnalysis.R
@@ -162,7 +162,7 @@
tibble()
}
}
- if (maxRecurse > 0 & length(result) > 0 && any(!!as.name(thresholdScore) >= threshold)) {
+ if (maxRecurse > 0 & length(result) > 0 && any(!!thresholdScore >= threshold)) {
recurseWith <- result %>%
filter(!!as.name(thresholdScore) >= threshold)
result <- collocationAnalysis(