Skip to content

Fix as_gt() examples #502

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

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions R/as_gt.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ as_gt <- function(x, ...) {
#'
#' @export
#'
#' @examplesIf interactive() && !identical(Sys.getenv("IN_PKGDOWN"), "true")
#' @examplesIf !identical(Sys.getenv("IN_PKGDOWN"), "true")
#' # Fixed design examples ----
#'
#' library(dplyr)
#'
#' # Enrollment rate
Expand Down Expand Up @@ -154,7 +156,10 @@ fd_footnote <- function(x, method) {
#'
#' @export
#'
#' @examplesIf interactive() && !identical(Sys.getenv("IN_PKGDOWN"), "true")
#' @examplesIf !identical(Sys.getenv("IN_PKGDOWN"), "true")
#' \donttest{
#' # Group sequential design examples ---
#'
#' library(dplyr)
#' # Example 1 ----
#' # The default output
Expand All @@ -163,15 +168,15 @@ fd_footnote <- function(x, method) {
#' summary() %>%
#' as_gt()
#'
#' gs_power_ahr() %>%
#' gs_power_ahr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt()
#'
#' gs_design_wlr() %>%
#' summary() %>%
#' as_gt()
#'
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt()
#'
Expand All @@ -190,7 +195,7 @@ fd_footnote <- function(x, method) {
#' # Example 2 ----
#' # Usage of title = ..., subtitle = ...
#' # to edit the title/subtitle
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt(
#' title = "Bound Summary",
Expand All @@ -200,7 +205,7 @@ fd_footnote <- function(x, method) {
#' # Example 3 ----
#' # Usage of colname_spanner = ..., colname_spannersub = ...
#' # to edit the spanner and its sub-spanner
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt(
#' colname_spanner = "Cumulative probability to cross boundaries",
Expand All @@ -210,7 +215,7 @@ fd_footnote <- function(x, method) {
#' # Example 4 ----
#' # Usage of footnote = ...
#' # to edit the footnote
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt(
#' footnote = list(
Expand All @@ -228,17 +233,17 @@ fd_footnote <- function(x, method) {
#' # Example 5 ----
#' # Usage of display_bound = ...
#' # to either show efficacy bound or futility bound, or both(default)
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt(display_bound = "Efficacy")
#'
#' # Example 6 ----
#' # Usage of display_columns = ...
#' # to select the columns to display in the summary table
#' gs_power_wlr() %>%
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
#' summary() %>%
#' as_gt(display_columns = c("Analysis", "Bound", "Nominal p", "Z", "Probability"))
#'
#' }
as_gt.gs_design <- function(
x,
title = NULL,
Expand Down
24 changes: 15 additions & 9 deletions man/as_gt.Rd

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

Loading