Skip to content

Commit

Permalink
purely cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 30, 2024
1 parent 6c85d78 commit 1228f66
Showing 1 changed file with 13 additions and 26 deletions.
39 changes: 13 additions & 26 deletions R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,26 @@
#'
summary.fixed_design <- function(object, ...) {
x <- object
x_design <- switch(x$design,
"ahr" = {
"Average hazard ratio"
},
"lf" = {
"Lachin and Foulkes"
},
"rd" = {
"Risk difference"
},
"milestone" = {
paste0("Milestone: tau = ", x$design_par$tau)
},
"rmst" = {
paste0("RMST: tau = ", x$design_par$tau)
},
"mb" = {
paste0("Modestly weighted LR: tau = ", x$design_par$tau)
},
"fh" = {
if (x$design_par$rho == 0 & x$design_par$gamma == 0) {
paste0("Fleming-Harrington FH(0, 0) (logrank)")
} else {
paste0("Fleming-Harrington FH(", x$design_par$rho, ", ", x$design_par$gamma, ")")
}
x_design <- switch(
x$design,
"ahr" = "Average hazard ratio",
"lf" = "Lachin and Foulkes",
"rd" = "Risk difference",
"milestone" = paste0("Milestone: tau = ", x$design_par$tau),
"rmst" = paste0("RMST: tau = ", x$design_par$tau),
"mb" = paste0("Modestly weighted LR: tau = ", x$design_par$tau),
"fh" = if (x$design_par$rho == 0 & x$design_par$gamma == 0) {
paste0("Fleming-Harrington FH(0, 0) (logrank)")
} else {
paste0("Fleming-Harrington FH(", x$design_par$rho, ", ", x$design_par$gamma, ")")
},
"maxcombo" = {
temp <- paste0(
"MaxCombo: FH(",
paste(apply(do.call(rbind, x$design_par[c(1:2)]), 2, paste, collapse = ", "), collapse = "), FH("),
")"
)
gsub(pattern = "FH\\(0, 0\\)", replacement = "logrank", x = temp)
gsub("FH\\(0, 0\\)", "logrank", temp)
}
)

Expand Down

0 comments on commit 1228f66

Please sign in to comment.