crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
651 stars 132 forks source link

Added minimum sufficient input validation to `add_mse()` #571

Closed mariusbarth closed 11 months ago

mariusbarth commented 12 months ago

I think the only necessary condition for add_mse() to work is that its first argument inherits from class data.frame, so this is exactly what we are checking here, now.

Question: Why not use validate(x, check_class = "data.frame")? Answer: "Error in validate(object, check_class = "data.frame"): ..." is not as informative as "Error in add_mse(object): ...".

codecov-commenter commented 12 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (5563e2c) 82.04% compared to head (ad0997b) 82.03%. Report is 7 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #571 +/- ## ========================================== - Coverage 82.04% 82.03% -0.02% ========================================== Files 45 45 Lines 4221 4224 +3 ========================================== + Hits 3463 3465 +2 - Misses 758 759 +1 ``` | [Files](https://app.codecov.io/gh/crsh/papaja/pull/571?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Frederik+Aust) | Coverage Δ | | |---|---|---| | [R/calculations.R](https://app.codecov.io/gh/crsh/papaja/pull/571?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Frederik+Aust#diff-Ui9jYWxjdWxhdGlvbnMuUg==) | `88.82% <100.00%> (+0.13%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/crsh/papaja/pull/571/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Frederik+Aust)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.