Skip to content

Commit fc3e9a6

Browse files
Merge pull request #502 from jdblischak/fix-as-gt-examples
Fix as_gt() examples
2 parents ff9a1d5 + d7938a3 commit fc3e9a6

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

R/as_gt.R

+15-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ as_gt <- function(x, ...) {
3232
#'
3333
#' @export
3434
#'
35-
#' @examplesIf interactive() && !identical(Sys.getenv("IN_PKGDOWN"), "true")
35+
#' @examplesIf !identical(Sys.getenv("IN_PKGDOWN"), "true")
36+
#' # Fixed design examples ----
37+
#'
3638
#' library(dplyr)
3739
#'
3840
#' # Enrollment rate
@@ -154,7 +156,10 @@ fd_footnote <- function(x, method) {
154156
#'
155157
#' @export
156158
#'
157-
#' @examplesIf interactive() && !identical(Sys.getenv("IN_PKGDOWN"), "true")
159+
#' @examplesIf !identical(Sys.getenv("IN_PKGDOWN"), "true")
160+
#' \donttest{
161+
#' # Group sequential design examples ---
162+
#'
158163
#' library(dplyr)
159164
#' # Example 1 ----
160165
#' # The default output
@@ -163,15 +168,15 @@ fd_footnote <- function(x, method) {
163168
#' summary() %>%
164169
#' as_gt()
165170
#'
166-
#' gs_power_ahr() %>%
171+
#' gs_power_ahr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
167172
#' summary() %>%
168173
#' as_gt()
169174
#'
170175
#' gs_design_wlr() %>%
171176
#' summary() %>%
172177
#' as_gt()
173178
#'
174-
#' gs_power_wlr() %>%
179+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
175180
#' summary() %>%
176181
#' as_gt()
177182
#'
@@ -190,7 +195,7 @@ fd_footnote <- function(x, method) {
190195
#' # Example 2 ----
191196
#' # Usage of title = ..., subtitle = ...
192197
#' # to edit the title/subtitle
193-
#' gs_power_wlr() %>%
198+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
194199
#' summary() %>%
195200
#' as_gt(
196201
#' title = "Bound Summary",
@@ -200,7 +205,7 @@ fd_footnote <- function(x, method) {
200205
#' # Example 3 ----
201206
#' # Usage of colname_spanner = ..., colname_spannersub = ...
202207
#' # to edit the spanner and its sub-spanner
203-
#' gs_power_wlr() %>%
208+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
204209
#' summary() %>%
205210
#' as_gt(
206211
#' colname_spanner = "Cumulative probability to cross boundaries",
@@ -210,7 +215,7 @@ fd_footnote <- function(x, method) {
210215
#' # Example 4 ----
211216
#' # Usage of footnote = ...
212217
#' # to edit the footnote
213-
#' gs_power_wlr() %>%
218+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
214219
#' summary() %>%
215220
#' as_gt(
216221
#' footnote = list(
@@ -228,17 +233,17 @@ fd_footnote <- function(x, method) {
228233
#' # Example 5 ----
229234
#' # Usage of display_bound = ...
230235
#' # to either show efficacy bound or futility bound, or both(default)
231-
#' gs_power_wlr() %>%
236+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
232237
#' summary() %>%
233238
#' as_gt(display_bound = "Efficacy")
234239
#'
235240
#' # Example 6 ----
236241
#' # Usage of display_columns = ...
237242
#' # to select the columns to display in the summary table
238-
#' gs_power_wlr() %>%
243+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
239244
#' summary() %>%
240245
#' as_gt(display_columns = c("Analysis", "Bound", "Nominal p", "Z", "Probability"))
241-
#'
246+
#' }
242247
as_gt.gs_design <- function(
243248
x,
244249
title = NULL,

man/as_gt.Rd

+15-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)