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

783 profile plots #792

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

783 profile plots #792

wants to merge 28 commits into from

Conversation

marlenesg
Copy link
Collaborator

Pull Request

Added the code for profile plots in Data-methods.R. I am not sure why the old changes in tests/testthat/test-sas-results-part-1.R and tests/testthat/test-sas-results-part-2.R are showing up. These changes have already been merged into the main branch previously.

Partially fixes #783

marlenesg and others added 25 commits February 1, 2023 11:54
Merge branch 'test-sas-results' of github.com:Roche/crmPack into test-sas-results

# Conflicts:
#	tests/testthat/test-sas-results.R
Merge branch 'test-sas-results' of github.com:Roche/crmPack into test-sas-results

# Conflicts:
#	tests/testthat/test-sas-results-part-1.R
Copy link
Contributor

github-actions bot commented Feb 9, 2024

badge

Code Coverage Summary

Filename                        Stmts    Miss  Cover    Missing
----------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
R/checkmate.R                      73       1  98.63%   72
R/crmPack-package.R                 4       0  100.00%
R/CrmPackClass-methods.R            5       0  100.00%
R/Data-class.R                    147       5  96.60%   43, 564-565, 571-576
R/Data-methods.R                  255      52  79.61%   140-200
R/Data-validity.R                 144       1  99.31%   21
R/Design-class.R                  391       0  100.00%
R/Design-methods.R               2775     771  72.22%   563-567, 591-594, 602-621, 626-655, 659-660, 662, 677-685, 689, 701-720, 1122-1126, 1253, 1267-1271, 1333, 1523, 1740, 1767-1770, 1779-1790, 1794-1813, 1824-1828, 1834-1846, 2109, 2134-2137, 2144-2155, 2159-2178, 2190-2194, 2200-2212, 2496-2499, 2527-2530, 2538-2550, 2553-2564, 2568-2604, 2621-2630, 2636-2651, 2676, 2717-2718, 2981-3451, 3546-3557, 3560-3571, 3575-3611, 3628-3637, 3645-3660, 3698, 3740-3741, 4020, 4022-4023, 4082, 4118, 4155-4158, 4177-4181, 4242-4249, 4277-4281, 4289-4307, 4333-4352, 4355, 4388, 4410-4428, 4697, 4792
R/Design-validity.R                38      10  73.68%   47-56
R/fromQuantiles.R                 176      67  61.93%   238-378
R/helpers_broom.R                  74      10  86.49%   30, 34-35, 37-38, 40, 81, 102-104
R/helpers_covr.R                   23       0  100.00%
R/helpers_data.R                   96       1  98.96%   139
R/helpers_design.R                126      41  67.46%   77-129, 250, 255-259
R/helpers_jags.R                   77       0  100.00%
R/helpers_kintr_Increments.R      156       2  98.72%   191, 278
R/helpers_knitr_CohortSize.R      100       0  100.00%
R/helpers_model.R                  85       4  95.29%   38, 89-90, 139
R/helpers_rules.R                 428       0  100.00%
R/helpers_samples.R                 5       0  100.00%
R/helpers_simulations.R            27       0  100.00%
R/helpers.R                       214      61  71.50%   107-127, 162-178, 200-304, 339-353
R/logger.R                         11       0  100.00%
R/mcmc.R                          290      18  93.79%   92-97, 376-377, 387, 389-390, 393-396, 579-580, 669, 675, 733
R/McmcOptions-class.R              22       0  100.00%
R/McmcOptions-methods.R             8       1  87.50%   43
R/McmcOptions-validity.R           42       0  100.00%
R/Model-class.R                  1062     166  84.37%   145-147, 216-218, 222-224, 283-285, 357-359, 363-365, 444-446, 513-515, 577-581, 584-587, 690-693, 697-698, 813-817, 937-939, 943-951, 1096-1098, 1103-1106, 1110-1113, 1229-1233, 1235-1238, 1242-1245, 1248, 1409-1419, 1424-1430, 1585-1588, 1594-1601, 1758, 1767, 1776, 1785, 1794-1799, 1935, 1944, 1953, 1961-1963, 2807-2836, 2840-2846, 2853-2857, 2862, 2969-2982, 3008, 3104-3106, 3110, 3203-3205, 3209, 3278-3290, 3308, 3368-3370, 3372-3373, 3376-3381
R/Model-methods.R                 472      38  91.95%   78, 233-238, 809-854, 1175-1184
R/Model-validity.R                443      16  96.39%   430-433, 442-445, 596-604
R/ModelParams-class.R              17       0  100.00%
R/ModelParams-validity.R           21       0  100.00%
R/Rules-class.R                   458       0  100.00%
R/Rules-methods.R                1541     184  88.06%   889, 892, 895, 1010, 1013, 1016, 1136-1139, 1173, 1276-1279, 1314, 2582-2590, 2614-2621, 2784-2793, 3073-3082, 3215-3458, 3745, 3749, 3794, 3798
R/Rules-validity.R                448      30  93.30%   684-723
R/Samples-class.R                   6       0  100.00%
R/Samples-methods.R              1188      21  98.23%   410-420, 648, 1665-1666, 1698, 1711, 1893, 2223-2228
R/Samples-validity.R               10       0  100.00%
R/Simulations-class.R             208       5  97.60%   784-787, 1043
R/Simulations-methods.R          1617    1473  8.91%    65-350, 406, 416-435, 448-453, 500-509, 674-2969
R/Simulations-validity.R           75      75  0.00%    20-168
R/utils.R                           6       0  100.00%
TOTAL                           13364    3053  77.16%

Diff against main

Filename            Stmts    Miss  Cover
----------------  -------  ------  -------
R/Data-methods.R      +52     +52  -20.39%
TOTAL                 +52     +52  -0.30%

Results for commit: b2ba80b

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Feb 9, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
CrmPackClass-class 💚 $22.28$ $-2.72$ $0$ $0$ $0$ $0$
CrmPackClass-methods 💔 $48.89$ $+2.22$ $0$ $0$ $0$ $0$
Rules-methods 💔 $46.17$ $+1.36$ $0$ $0$ $0$ $0$
helpers_knitr 💔 $21.13$ $+6.60$ $0$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
CrmPackClass-class 💚 $22.15$ $-2.72$ CrmPackClass_correctly_identifies_crmPack_classes
CrmPackClass-methods 💔 $21.70$ $+2.85$ tidy_methods_return_non_empty_value_for_all_classes
helpers_knitr 💔 $20.50$ $+6.58$ asis_parameter_works_correctly_for_all_implemented_methods

Results for commit 4a87aec

♻️ This comment has been updated with latest results.

@danielinteractive danielinteractive added this to To Start Review in crmPack Board via automation Feb 9, 2024
Copy link
Collaborator

@danielinteractive danielinteractive left a comment

Choose a reason for hiding this comment

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

thanks @marlenesg , nice work (and nice small PR!! Great!) - on top of comments below, can you please add test(s)?

)
setMethod(
f = "profiles",
signature = signature(x = "Data", xNE = "data.frame", unit = "character"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

how about another name instead of xNE ? e.g. x_not_eval?

p <- ggplot(data = df) +
geom_point(
aes(
x = factor(ID, levels = unique(ID[order(cohort, ID)])),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we might need to work with

Suggested change
x = factor(ID, levels = unique(ID[order(cohort, ID)])),
x = factor(.data$ID, levels = unique(.data$ID[order(.data$cohort, .data$ID)])),

etc. to avoid R CMD check notes about missing global variables, please double check the R CMD check output

Comment on lines +174 to +177
scale_shape_manual(values = c(
"DLT No" = 19, "DLT Yes" = 17,
"Not evaluable" = 0
), drop = FALSE) +
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would recommend making this configurable by the user, i.e. here:

Suggested change
scale_shape_manual(values = c(
"DLT No" = 19, "DLT Yes" = 17,
"Not evaluable" = 0
), drop = FALSE) +
scale_shape_manual(values = scale_shape_values, drop = FALSE) +

and in the arguments of this method

scale_shape_values = c(
        "DLT No" = 19, "DLT Yes" = 17,
        "Not evaluable" = 0
      )

so that the user can keep defaults, or modify this

"Not evaluable" = 0
), drop = FALSE) +
scale_color_manual(
values = c(
Copy link
Collaborator

Choose a reason for hiding this comment

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

same idea also here

Comment on lines +196 to +203
theme_bw() +
theme(plot.title = element_text(hjust = 0.5)) +
theme(legend.title = element_blank()) +
theme(
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"),
axis.text.x = element_text(angle = 45, hjust = 1)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep the theme modifiable by the user.
options:

  • completely omit this here to just use the default theme
  • if that does not look ok, then define a theme_profiles function that returns this and in this method have argument theme = theme_profiles() that is then used here, but the user could modify it

@danielinteractive
Copy link
Collaborator

@marlenesg any questions / should we go through comments together?

@danielinteractive danielinteractive moved this from To Start Review to Review in progress in crmPack Board Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
crmPack Board
Review in progress
Development

Successfully merging this pull request may close these issues.

Suggestion: DLT profile plot and Prob(DLT) plot with shaded loss areas
2 participants