Skip to content

Improve the handling of age.var and id.vars within charlson comorbidities#44

Merged
dewittpe merged 1 commit intomainfrom
fix-43
Feb 26, 2026
Merged

Improve the handling of age.var and id.vars within charlson comorbidities#44
dewittpe merged 1 commit intomainfrom
fix-43

Conversation

@dewittpe
Copy link
Copy Markdown
Owner

Prior to this change when Charlson comorbidities were requested and id.vars was NULL and age.var was not NULL then there would be an error as the merge to add the age scores onto the results. When there was more than one age value for a unique id.var, the return will have more than one row for the id.var. This is conceptually bad.

This change adds to tests/test-comorbidites.R to check for warning messages and expected returns when the id.vars are not one-to-one with c(id.vars, age.var) These changes make sure the error does not occur. Warnings are thrown when there is more than one age for the id.vars

fix #43

…ties

Prior to this change when Charlson comorbidities were requested and
id.vars was NULL and age.var was not NULL then there would be an error
as the merge to add the age scores onto the results.  When
there was more than one age value for a unique id.var, the return will
have more than one row for the id.var.  This is conceptually bad.

This change adds to tests/test-comorbidites.R to check for warning
messages and expected returns when the id.vars are not one-to-one with
c(id.vars, age.var)  These changes make sure the error does not occur.
Warnings are thrown when there is more than one age for the id.vars

fix #43
@dewittpe dewittpe self-assigned this Feb 26, 2026
@dewittpe dewittpe added the bug Something isn't working label Feb 26, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (517bb53) to head (b76a89d).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   96.54%   96.57%   +0.02%     
==========================================
  Files          17       17              
  Lines        1304     1314      +10     
==========================================
+ Hits         1259     1269      +10     
  Misses         45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dewittpe dewittpe merged commit c71a7d8 into main Feb 26, 2026
9 checks passed
@dewittpe dewittpe deleted the fix-43 branch February 26, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error or unexpected number of rows for Charlson scores when age.var and id.vars do not have a one-to-one relationship

1 participant