Skip to content

Commit 9ccde9c

Browse files
committed
Fix as_gt() examples
1 parent ff9a1d5 commit 9ccde9c

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

R/as_gt.R

Lines changed: 13 additions & 9 deletions
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,9 @@ 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+
#' # Group sequential design examples ---
161+
#'
158162
#' library(dplyr)
159163
#' # Example 1 ----
160164
#' # The default output
@@ -163,15 +167,15 @@ fd_footnote <- function(x, method) {
163167
#' summary() %>%
164168
#' as_gt()
165169
#'
166-
#' gs_power_ahr() %>%
170+
#' gs_power_ahr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
167171
#' summary() %>%
168172
#' as_gt()
169173
#'
170174
#' gs_design_wlr() %>%
171175
#' summary() %>%
172176
#' as_gt()
173177
#'
174-
#' gs_power_wlr() %>%
178+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
175179
#' summary() %>%
176180
#' as_gt()
177181
#'
@@ -190,7 +194,7 @@ fd_footnote <- function(x, method) {
190194
#' # Example 2 ----
191195
#' # Usage of title = ..., subtitle = ...
192196
#' # to edit the title/subtitle
193-
#' gs_power_wlr() %>%
197+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
194198
#' summary() %>%
195199
#' as_gt(
196200
#' title = "Bound Summary",
@@ -200,7 +204,7 @@ fd_footnote <- function(x, method) {
200204
#' # Example 3 ----
201205
#' # Usage of colname_spanner = ..., colname_spannersub = ...
202206
#' # to edit the spanner and its sub-spanner
203-
#' gs_power_wlr() %>%
207+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
204208
#' summary() %>%
205209
#' as_gt(
206210
#' colname_spanner = "Cumulative probability to cross boundaries",
@@ -210,7 +214,7 @@ fd_footnote <- function(x, method) {
210214
#' # Example 4 ----
211215
#' # Usage of footnote = ...
212216
#' # to edit the footnote
213-
#' gs_power_wlr() %>%
217+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
214218
#' summary() %>%
215219
#' as_gt(
216220
#' footnote = list(
@@ -228,14 +232,14 @@ fd_footnote <- function(x, method) {
228232
#' # Example 5 ----
229233
#' # Usage of display_bound = ...
230234
#' # to either show efficacy bound or futility bound, or both(default)
231-
#' gs_power_wlr() %>%
235+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
232236
#' summary() %>%
233237
#' as_gt(display_bound = "Efficacy")
234238
#'
235239
#' # Example 6 ----
236240
#' # Usage of display_columns = ...
237241
#' # to select the columns to display in the summary table
238-
#' gs_power_wlr() %>%
242+
#' gs_power_wlr(lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.1)) %>%
239243
#' summary() %>%
240244
#' as_gt(display_columns = c("Analysis", "Bound", "Nominal p", "Z", "Probability"))
241245
#'

man/as_gt.Rd

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)