-
-
Notifications
You must be signed in to change notification settings - Fork 3
kmg plot #141
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
base: main
Are you sure you want to change the base?
kmg plot #141
Conversation
|
try and use exisitng structure and surv functions, refactoring will be addressed in #142 |
Unit Tests Summary 1 files 71 suites 1m 28s ⏱️ Results for commit 67f9bcf. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 45fde37 ♻️ This comment has been updated with latest results. |
Code Coverage SummaryDiff against mainResults for commit: 67f9bcf Minimum allowed coverage is ♻️ This comment has been updated with latest results |
|
need examples and export |
|
my styler is failing, @edelarua , i was wondering how you guys check style here https://github.com/insightsengineering/crane/actions/runs/19792793759/job/56708402248?pr=141 |
Missing link(s) in Rd file 'annot_surv_med.Rd': Missing link(s) in Rd file 'h_tbl_coxph_pairwise.Rd': Missing link(s) in Rd file 's_coxph_pairwise.Rd': See section 'Cross-references' in the 'Writing R Extensions' manual.
|
DESCRIPTION
Outdated
| cowplot (>= 1.2.0), | ||
| checkmate (>= 2.3.2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do not need checkmate AND assertthat. Also I would not add them as we do not need them in nest 2.0 (bad error messaging)
| #' annot_cox_ph(plt_kmg01, coxph_tbl) | ||
| #' | ||
| annot_cox_ph <- function(gg_plt, coxph_tbl, control_annot_coxph = control_coxph_annot(), font_size = 10) { | ||
| # ... (function body remains the same) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this line
R/gkm.R
Outdated
| g_km <- function( | ||
| surv_plot_data, | ||
| col = NULL, | ||
| lty = NULL, | ||
| lwd = 0.5, | ||
| censor_show = TRUE, | ||
| pch = 3, | ||
| size = 2, | ||
| max_time = NULL, | ||
| xticks = NULL, | ||
| xlab = "Days", | ||
| yval = c("Survival", "Failure"), | ||
| ylab = paste(yval, "Probability"), | ||
| ylim = NULL, | ||
| title = NULL, | ||
| footnotes = NULL, | ||
| font_size = 10, | ||
| ci_ribbon = FALSE, | ||
| legend_pos = NULL, | ||
| ggtheme = NULL | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too many parameters imo
R/gkm.R
Outdated
| #' @param surv_plot_data A data frame containing the pre-processed survival data, ready for plotting. | ||
| #' This data should be equivalent to the output of \code{h_data_plot}. | ||
| #' @param col A character vector of colors for the survival curves. Length should match number of arms. | ||
| #' @param lty A vector of line types for the survival curves, or \code{NULL} for default. | ||
| #' @param lwd Numeric value specifying line width for the survival curves. | ||
| #' @param censor_show Logical, whether to display censoring marks on the plot. | ||
| #' @param pch Plotting character for censoring marks. | ||
| #' @param size Size of the censoring marks. | ||
| #' @param max_time Numeric, the maximum time point to display on the x-axis. | ||
| #' @param xticks Numeric vector of x-axis tick positions, or a single number for the interval, or \code{NULL} for auto. | ||
| #' @param xlab Character string for the x-axis label. | ||
| #' @param yval Character string, either \code{"Survival"} or \code{"Failure"} to plot Survival or Failure probability. | ||
| #' @param ylab Character string for the y-axis label. | ||
| #' @param ylim Numeric vector of length 2 for y-axis limits. | ||
| #' @param title Character string for the plot title. | ||
| #' @param footnotes Character string for plot footnotes/caption. | ||
| #' @param font_size Numeric, base font size for the plot theme. | ||
| #' @param ci_ribbon Logical, whether to display confidence intervals as a ribbon (area). | ||
| #' @param legend_pos Numeric vector of length 2 for legend position (x, y) relative to the plot area (0 to 1), or \code{NULL} for auto-placement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter description does not reflect the rest of the package standard
R/gkm.R
Outdated
| xend = tot_width - 0.1 * tail(colwidths, 1), y = nrow(df) - | ||
| 0.5, yend = nrow(df) - 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to style this a bit
R/gkm.R
Outdated
| current_row <- data.frame( | ||
| hr = sprintf("%.2f", coxph_ans$conf.int[1, 1]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use glue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go for it
|
hi davide, can you fix the test please https://github.com/insightsengineering/crane/actions/runs/19936180249/job/57161536238 thanks |
What changes are proposed in this pull request?
NEWS.md. (#, @)Provide more detail here as needed.
Reference GitHub issue associated with pull request. e.g., 'closes #'
Pre-review Checklist (if item does not apply, mark is as complete)
usethis::pr_merge_main()devtools::test_coverage()Reviewer Checklist (if item does not apply, mark is as complete)
pkgdown::build_site(). Check the R console for errors, and review the rendered website.devtools::test_coverage()When the branch is ready to be merged:
NEWS.mdwith the changes from this pull request under the heading "# cards (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.mdfor examples).