easystats / effectsize

:dragon: Compute and work with indices of effect size and standardized parameters
https://easystats.github.io/effectsize/
Other
331 stars 22 forks source link

Bug Report: mis-quoting `cohens_d()` in `hedges_g()` #636

Closed ddsjoberg closed 1 month ago

ddsjoberg commented 3 months ago

There was a recent update in {effectsize} that now requires the library to be loaded for hedges_g() to function.

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

effectsize::hedges_g(mpg ~ am, data = mtcars)
#> Error in cohens_d(x = mpg ~ am, data = mtcars, adjust = TRUE): could not find function "cohens_d"

Created on 2024-04-02 with reprex v2.1.0

When the effectsize package is not loaded, this quoting of cohens_d cannot locate the function. One way you fix the issue by namespacing the quoted function, e.g. cl[[1]] <- quote(effectsize::cohens_d)

https://github.com/easystats/effectsize/blob/7c85fdfa788903312094922108578538493f5a1b/R/cohens_d.R#L163C3-L163C29

Thank you for the amazing package (and entire ecosystem of packages)! 👯 👯 👯

mattansb commented 3 months ago

Oh interesting catch! Should be fixed now.

Sorry for the inconvenience it causes in your package...

ddsjoberg commented 3 months ago

Thank you for the quick fix!

IndrajeetPatil commented 3 months ago

@mattansb Should we do a hotfix release?

I think it's in order; this is going to affect quite a few packages, as Cohen's d and Hedges' g are widely used by downstream deps.

mattansb commented 3 months ago

Hmmm you might be right. Weird that revdep didn't catch anything.

I'll do it in the next few days.

strengejacke commented 3 months ago

I'm not sure, but revdep doesn't check suggested packages? And if something isn't tested, it doesn't fail, either.

ddsjoberg commented 2 months ago

Hello again! Are you planning on making a release since this you made this fix? I personally think it's warranted, but it's not my package 😝 Thanks again for the great ecosystem of packages! 🌟🌟🌟