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

Fix tidy.brmsfit() output for model without a ran_pars component #148

Merged
merged 3 commits into from
Mar 30, 2024

Conversation

matthieu-bruneaux
Copy link
Contributor

Fixes #147.

Changes to R/brms_tidiers.R:

  • In the tidy.brmsfit() function, reformat the "group" and "term" columns of the out object in the case when nrow(res_list$fixed) > 0 but nrow(res_list$ran_pars) == 0 (in this case, those columns were lists with NULL values instead of vectors of NA).

Changes to inst/extdata/run_examples.R:

  • Add a new example brms_brm_fit4 for the brms package, taken from ?brms::brm. This example is used to test that the fix to tidy.brmsfit() works fine.
  • This added example is saved to inst/extdata/brms_example.rda with the other brms examples already present.

Changes to tests/testthat/test-brms.R:

  • Add some basic tests to check that the columns "effect", "component", "group", and "term" of tidy.brmsfit() output are correct, using some brms examples already shipped with broom.mixed and the newly added brms example brms_brm_fit4.

@bbolker bbolker merged commit c6037eb into bbolker:main Mar 30, 2024
1 check passed
@bbolker
Copy link
Owner

bbolker commented Mar 30, 2024

Sorry this slipped through the cracks!

@matthieu-bruneaux
Copy link
Contributor Author

Thank you for accepting this PR @bbolker! And thanks a lot for the great package!

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 this pull request may close these issues.

Columns "group" and "term" of tidy.brmsfit() output contain "NULL" cells for some models
2 participants