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

Pull Request by Zilin Huang regarding Issue #222 #229

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
9 changes: 9 additions & 0 deletions R/ggcuminc.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ ggcuminc <- function(x, outcome = NULL,
)
}

# Generate an error if the input is a `survfit.coxphms` regression model: ----
if (inherits(x, "survfitcoxms")) {
cli_abort(
"Argument {.arg x} does not support {.cls survfit.coxphms} object.
Please fit a multi-state model with another project, such as {.fn coxph}."
)
}

Comment on lines +58 to +65
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use the simplified text we discussed here.

# prep data to be passed to ggplot() -----------------------------------------
if (inherits(x, "tidycuminc"))
df <- tidy_cuminc(x = x)
Expand All @@ -71,6 +79,7 @@ ggcuminc <- function(x, outcome = NULL,
if (any(!outcome %in% unique(df$outcome))) {
cli_abort("Argument {.code outcome} must be one or more of {.val {unique(df$outcome)}}")
}

df <- dplyr::filter(df, .data$outcome %in% .env$outcome)

# construct aes() call -------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions R/utils-add_risktable.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# get data to place in risktables --------------------------------------------
times <- times %||% plot_build$layout$panel_params[[1]]$x.sec$breaks

df_times <-
.prepare_data_for_risk_tables(data = x$data, times = times, combine_groups = combine_groups)

Expand Down
9 changes: 9 additions & 0 deletions man/scale_ggsurvfit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 8 additions & 39 deletions man/stepribbon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.