Skip to content

Commit

Permalink
Update ard_survival_survdiff.R
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Apr 15, 2024
1 parent 83a955f commit fd19c77
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/ard_survival_survdiff.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ ard_survival_survdiff <- function(formula, data, rho = 0, ...) {

# tidy results up in an ARD format -------------------------------------------
# extract variable names from formula
variables <- stats::terms(formula) |> attr("term.labels") |> .strip_backticks()
variables <- stats::terms(formula) |>
attr("term.labels") |>
.strip_backticks()

# if there was an error, return results early
if (is.null(lst_glance[["result"]])) {
Expand All @@ -61,7 +63,8 @@ ard_survival_survdiff <- function(formula, data, rho = 0, ...) {
cli::cli_abort(
message =
c("There was an error in {.fun survival::survdiff}. See below:",
"x" = lst_glance[["error"]]),
"x" = lst_glance[["error"]]
),
call = get_cli_abort_call()
)
}
Expand All @@ -77,7 +80,7 @@ ard_survival_survdiff <- function(formula, data, rho = 0, ...) {
stats =
if (!is.null(lst_glance[["result"]])) unname(as.list(lst_glance[["result"]]))
else rep_along(c("statistic", "df", "p.value"), list(NULL)) |> c(list(method = method))
#styler: on
# styler: on
) |>
.add_survdiff_stat_labels() |>
dplyr::mutate(
Expand Down

0 comments on commit fd19c77

Please sign in to comment.