Skip to content

Commit

Permalink
Merge pull request #52 from MicheleNuijten/bugfix-grepl-error
Browse files Browse the repository at this point in the history
bug fix: also ignore capital Z with df
  • Loading branch information
MicheleNuijten authored Nov 17, 2022
2 parents 6401d9b + e6b0fc2 commit 817c87a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/regex.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RGX_T <- "t"
RGX_R <- "r"
RGX_Q <- "Q\\s?-?\\s?(w|W|(w|W)ithin|b|B|(b|B)etween)?"
RGX_F <- "F"
RGX_CHI2 <- "((\\[CHI\\]|\\[DELTA\\]G)\\s?|(\\s[^trFzQWnD ]\\s?)|([^trFzQWnD ]2\\s?))2?"
RGX_CHI2 <- "((\\[CHI\\]|\\[DELTA\\]G)\\s?|(\\s[^trFzZQWnD ]\\s?)|([^trFzZQWnD ]2\\s?))2?"
RGX_Z <- "([^a-z](z|Z))"

# degrees of freedom
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-extract-z-tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ test_that("upper case z-tests are retrieved from text", {

# z test cannot have df
test_that("a z followed by degrees of freedom is not matched", {
txt <- " z(28) = 2.20, p = .03"
txt1 <- " z(28) = 2.20, p = .03"
txt2 <- " Z(28) = 2.20, p = .03"

expect_output(statcheck(txt, messages = FALSE), "did not find any results")
expect_output(statcheck(c(txt1, txt2), messages = FALSE), "did not find any results")

})

0 comments on commit 817c87a

Please sign in to comment.