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

Implement cards::as_card() #201

Merged
merged 9 commits into from
Aug 21, 2024
Merged

Implement cards::as_card() #201

merged 9 commits into from
Aug 21, 2024

Conversation

edelarua
Copy link
Contributor

@edelarua edelarua commented Aug 21, 2024

What changes are proposed in this pull request?

  • Implement cards::as_card() where needed in the package to convert data frames to class 'card'.

Closes #200


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • If a new ard_*() function was added, it passes the ARD structural checks from cards::check_ard_structure().
  • If a new ard_*() function was added, set_cli_abort_call() has been set.
  • If a new ard_*() function was added and it depends on another package (such as, broom), is_pkg_installed("broom", reference_pkg = "cardx") has been set in the function call and the following added to the roxygen comments: @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom"", reference_pkg = "cardx"))
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()

Reviewer Checklist (if item does not apply, mark is as complete)

  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features: devtools::test_coverage()

When the branch is ready to be merged:

  • Update NEWS.md with the changes from this pull request under the heading "# cardx (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • All GitHub Action workflows pass with a ✅
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge" or "Rebase and merge".

@edelarua edelarua added the sme label Aug 21, 2024
Copy link
Contributor

github-actions bot commented Aug 21, 2024

Unit Tests Summary

  1 files  102 suites   59s ⏱️
102 tests 102 ✅ 0 💤 0 ❌
576 runs  576 ✅ 0 💤 0 ❌

Results for commit a97a6ac.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Aug 21, 2024

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
ard_categorical.survey.design 💚 $17.90$ $-1.66$ ard_categorical.survey.design_works
ard_continuous.survey.design 💔 $13.59$ $+1.19$ unstratified_ard_continuous.survey.design_works

Results for commit 6554471

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Aug 21, 2024

badge

Code Coverage Summary

Filename                                Stmts    Miss  Cover    Missing
------------------------------------  -------  ------  -------  ---------------------------------------------------------------------------
R/add_total_n.survey.design.R              12       0  100.00%
R/ard_aod_wald_test.R                      78       8  89.74%   39-44, 94, 97
R/ard_attributes.survey.design.R            2       0  100.00%
R/ard_car_anova.R                          45       2  95.56%   62, 65
R/ard_car_vif.R                            61       2  96.72%   52, 86
R/ard_categorical_ci.R                     96       6  93.75%   83, 134-138
R/ard_categorical_ci.survey.design.R      128       3  97.66%   152-153, 179
R/ard_categorical.survey.design.R         391      12  96.93%   77, 126-129, 226-229, 273, 515, 529
R/ard_continuous_ci.R                      28       1  96.43%   38
R/ard_continuous_ci.survey.design.R       137       4  97.08%   55-57, 208
R/ard_continuous.survey.design.R          201       3  98.51%   86, 177, 187
R/ard_dichotomous.survey.design.R          73       3  95.89%   51, 156, 161
R/ard_effectsize_cohens_d.R               103       2  98.06%   69, 122
R/ard_effectsize_hedges_g.R                91       2  97.80%   68, 120
R/ard_emmeans_mean_difference.R            70       0  100.00%
R/ard_missing.survey.design.R              79       1  98.73%   52
R/ard_regression_basic.R                   16       1  93.75%   46
R/ard_regression.R                         73       0  100.00%
R/ard_smd_smd.R                            69       5  92.75%   57, 83-86
R/ard_stats_anova.R                        95       0  100.00%
R/ard_stats_aov.R                          36       0  100.00%
R/ard_stats_chisq_test.R                   40       1  97.50%   39
R/ard_stats_fisher_test.R                  43       1  97.67%   42
R/ard_stats_kruskal_test.R                 36       1  97.22%   38
R/ard_stats_mcnemar_test.R                 80       2  97.50%   63, 106
R/ard_stats_mood_test.R                    49       1  97.96%   45
R/ard_stats_oneway_test.R                  39       0  100.00%
R/ard_stats_prop_test.R                    85       1  98.82%   43
R/ard_stats_t_test_onesample.R             41       0  100.00%
R/ard_stats_t_test.R                      112       2  98.21%   65, 111
R/ard_stats_wilcox_test_onesample.R        42       0  100.00%
R/ard_stats_wilcox_test.R                  99       2  97.98%   65, 117
R/ard_survey_svychisq.R                    38       1  97.37%   44
R/ard_survey_svyranktest.R                 54       1  98.15%   44
R/ard_survey_svyttest.R                    53       1  98.11%   42
R/ard_survival_survdiff.R                  89       0  100.00%
R/ard_survival_survfit_diff.R              76       8  89.47%   31-34, 43-46
R/ard_survival_survfit.R                  174      13  92.53%   79-81, 85, 95-97, 128-132, 237
R/construction_helpers.R                  105      39  62.86%   101-104, 107-111, 143-146, 149-153, 164-169, 192, 204-208, 234-238, 245-249
R/proportion_ci.R                         195      28  85.64%   290, 293, 302-307, 315, 330, 438-461
TOTAL                                    3334     157  95.29%

Diff against main

Filename                                Stmts    Miss  Cover
------------------------------------  -------  ------  --------
R/ard_categorical_ci.R                     +3      +1  -0.87%
R/ard_categorical_ci.survey.design.R       +1       0  +0.02%
R/ard_categorical.survey.design.R          -1      -1  +0.25%
R/ard_continuous_ci.R                      +4      +1  -3.57%
R/ard_continuous_ci.survey.design.R        +1       0  +0.02%
R/ard_effectsize_cohens_d.R                +1       0  +0.02%
R/ard_effectsize_hedges_g.R                +1       0  +0.02%
R/ard_missing.survey.design.R              +2      +1  -1.27%
R/ard_smd_smd.R                            +1       0  +0.11%
R/ard_stats_chisq_test.R                   +1       0  +0.06%
R/ard_stats_fisher_test.R                  +1       0  +0.06%
R/ard_stats_kruskal_test.R                 +1       0  +0.08%
R/ard_stats_mcnemar_test.R                 +1       0  +0.03%
R/ard_stats_mood_test.R                    +1       0  +0.04%
R/ard_stats_oneway_test.R                  +1       0  +100.00%
R/ard_stats_prop_test.R                    +1       0  +0.01%
R/ard_stats_t_test_onesample.R             +1       0  +100.00%
R/ard_stats_t_test.R                       +1       0  +0.02%
R/ard_stats_wilcox_test_onesample.R        +1       0  +100.00%
R/ard_stats_wilcox_test.R                  +1       0  +0.02%
R/ard_survey_svychisq.R                    +1       0  +0.07%
R/ard_survey_svyranktest.R                 +3      +1  -1.85%
R/ard_survey_svyttest.R                    +3      +1  -1.89%
TOTAL                                     +31      +4  -0.08%

Results for commit: a97a6ac

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhh THANK YOU!!!

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you resolve the merge conflict then we can merge this one ?

@edelarua
Copy link
Contributor Author

Can you resolve the merge conflict then we can merge this one ?

Should be good to go now!

@edelarua edelarua requested a review from ddsjoberg August 21, 2024 20:13
Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank for adding this in cardx too!!

@ddsjoberg ddsjoberg merged commit bb00764 into main Aug 21, 2024
33 checks passed
@ddsjoberg ddsjoberg deleted the 200_as_card@main branch August 21, 2024 20:45
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use cards::as_card()
2 participants