Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug geometric_mean function #153

Closed
2 tasks
juan-umana opened this issue Nov 8, 2024 · 0 comments · Fixed by #154
Closed
2 tasks

Bug geometric_mean function #153

juan-umana opened this issue Nov 8, 2024 · 0 comments · Fixed by #154

Comments

@juan-umana
Copy link
Member

Please place an "x" in all the boxes that apply

  • [ X] I have the most recent version of epiCo and R
  • [ X] I have found a bug
  • I have a reproducible example
  • I want to request a new feature

Please include a brief description of the problem with a code example:

The geometric_mean function is not subsetting the positive values from the vector, so when it checks the values inside it arise an error instead of ignoring the non positive values

  if (method == "positive") {
    stopifnot("`x` includes zero or negative values,
              check the geom_mean methods" = all(x > 0))

    gm <- exp(mean(log(x)))

@juan-umana juan-umana changed the title Bug in geometric_mean function with positive method Bug geometric_mean function Nov 8, 2024
@juan-umana juan-umana linked a pull request Nov 8, 2024 that will close this issue
2 tasks
@juan-umana juan-umana mentioned this issue Nov 12, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant