easystats / report

:scroll: :tada: Automated reporting of objects in R
https://easystats.github.io/report/
Other
695 stars 69 forks source link

Fix failing snapshots1: `report.htest-chi2` #421

Closed rempsyc closed 7 months ago

rempsyc commented 7 months ago

Currently, snapshots are failing in two ways:

The first one emerges from report.htest-chi2:

Test `report.htest-chi2 for given probabilities` is failing:
Error: Error: Snapshot of code has changed (variant 'windows'):
old vs new
  Code
    report(x)
  Output
-   Effect sizes were labelled following Funder's (2019) recommendations.
+   

    The Chi-squared test for given probabilities / goodness of fit of
    table(mtcars$cyl) to a distribution of [4: n=3.2, 6: n=9.6, 8: n=19.2] suggests
-   that the effect is statistically significant, and medium (chi2 = 21.12, p < # BEFORE
+   that the effect is statistically significant, and (chi2 = 21.12, p < .001; Fei # AFTER
-   .001; Fei = 0.27, 95% CI [0.17, 1.00])
+   = 0.27, 95% CI [0.17, 1.00])

* Run `testthat::snapshot_accept('windows/report.htest-chi2')` to accept the change.
* Run `testthat::snapshot_review('windows/report.htest-chi2')` to interactively review the change.

✔ All tests passing in `tests/testthat/test-report.aov.R`.
✔ All tests passing in `tests/testthat/test-report.htest-correlation.R`.
✔ All tests passing in `tests/testthat/test-report_sample.R`.

The issue is that the effect size characteriziation "medium" is missing now, so report is probably not able to extract it from effectsize anymore.

That works correctly locally on performance ‘0.11.0’, but seems to fail on the devel version.

Example: https://github.com/easystats/report/actions/runs/8489838483/job/23260331381

rempsyc commented 7 months ago

Strange, even after download effectsize devel version, it works locally on my machine 🤔 (and after updating my local all packages)

library(report)

packageVersion("effectsize")
#> [1] '0.8.6.6'

x <- suppressWarnings(chisq.test(table(mtcars$cyl), p = c(0.1, 0.3, 0.6)))

report_effectsize(x)
#> Effect sizes were labelled following Funder's (2019) recommendations. 
#> 
#> medium (Fei = 0.27, 95% CI [0.17, 1.00])

report(x)
#> Effect sizes were labelled following Funder's (2019) recommendations.
#> 
#> The Chi-squared test for given probabilities / goodness of fit of
#> table(mtcars$cyl) to a distribution of [4: n=3.2, 6: n=9.6, 8: n=19.2] suggests
#> that the effect is statistically significant, and medium (chi2 = 21.12, p <
#> .001; Fei = 0.27, 95% CI [0.17, 1.00])

Created on 2024-03-30 with reprex v2.1.0

mattansb commented 7 months ago

So... resolved?

rempsyc commented 7 months ago

Apparently yes in the last tests!?? So strange lol