Skip to content

Commit aa98a75

Browse files
authored
Merge pull request #152 from keaven/check-notes
Fix `R CMD check` notes
2 parents b4a2047 + 0213eff commit aa98a75

File tree

6 files changed

+17
-28
lines changed

6 files changed

+17
-28
lines changed

R/gsMethods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ print.nSurvival <- function(x, ...) {
329329
#' package, \code{addTable.RTF()} (from the rtf package) to produce console or
330330
#' R Markdown output or output to a variety of file types. \code{xprint()} is
331331
#' provided for LaTeX output by setting default options for
332-
#' \code{\link{print.xtable}()} when producing tables summarizing design
332+
#' \code{\link[xtable]{print.xtable}} when producing tables summarizing design
333333
#' bounds.
334334
#'
335335
#' Individual transformation of z-value test statistics for interim and final

man/gsBoundSummary.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/ConditionalErrorSpending.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: "Conditional Error Spending Functions"
3-
output:
4-
rmarkdown::html_document:
5-
code_folding: hide
3+
output: rmarkdown::html_vignette
64
bibliography: gsDesign.bib
75
vignette: >
86
%\VignetteIndexEntry{Conditional Error Spending Functions}
@@ -168,7 +166,7 @@ corresponding conditional error computations.
168166
We have two utility functions. Transposing a tibble and a custom function
169167
to compute conditional error.
170168

171-
```{r, class.source = 'fold-hide'}
169+
```{r}
172170
# Custom function to transpose while preserving names
173171
# From https://stackoverflow.com/questions/42790219/how-do-i-transpose-a-tibble-in-r
174172
transpose_df <- function(df) {

vignettes/GentleIntroductionToGSD.Rmd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: "A gentle introduction to group sequential design"
3-
output:
4-
rmarkdown::html_document:
5-
code_folding: show
3+
output: rmarkdown::html_vignette
64
bibliography: gsDesign.bib
75
vignette: >
86
%\VignetteIndexEntry{A gentle introduction to group sequential design}

vignettes/VaccineEfficacy.Rmd

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: "Vaccine Efficacy Trial Design"
3-
output:
4-
rmarkdown::html_document:
5-
code_folding: show
3+
output: rmarkdown::html_vignette
64
bibliography: gsDesign.bib
75
vignette: >
86
%\VignetteIndexEntry{Vaccine Efficacy Trial Design}
@@ -26,7 +24,7 @@ knitr::opts_chunk$set(
2624
options(width = 58)
2725
```
2826

29-
```{r, message=FALSE, warning=FALSE, class.source="fold-hide"}
27+
```{r, message=FALSE, warning=FALSE}
3028
library(gsDesign)
3129
library(gt)
3230
library(dplyr)
@@ -63,7 +61,7 @@ p &= rP_E/(rP_E+ P_C)\\
6361
\end{aligned}
6462
$$
6563

66-
As noted, this approximation is dependent on a large sample size and small probability of events.
64+
As noted, this approximation is dependent on a large sample size and small probability of events.
6765
The above can be inverted to obtain
6866

6967
$$\pi = 1 - \frac{1}{r(1/p-1)}. $$
@@ -105,7 +103,7 @@ tibble(VE = ve, "P(Experimental)" = prob_experimental) %>%
105103

106104

107105

108-
Chapter 12 of @JTBook walks through how to design and analyze such a study using a fixed or group sequential design.
106+
Chapter 12 of @JTBook walks through how to design and analyze such a study using a fixed or group sequential design.
109107
The time-to-event approximation provides an initial approximation to computing bounds; more importantly, it provides sample size and study duration approximations that are not given by the Jennison and Turnbull approach.
110108

111109
# The time-to-event approach
@@ -166,7 +164,7 @@ x <- gsSurv(
166164
```
167165

168166
Now we convert this to a design with integer event counts at analyses.
169-
This is achieved by rounding interim analysis event counts from the above design and rounding up the final analysis event count.
167+
This is achieved by rounding interim analysis event counts from the above design and rounding up the final analysis event count.
170168
This will result in a slight change in event fractions at interim analyses as well as a slight change from the targeted 90% power.
171169
We now explain the rationale behind the spending function choices.
172170
Recall that the hazard ratio (HR) is 1 minus the VE.
@@ -316,7 +314,7 @@ xb$upper$bound
316314

317315

318316

319-
The vaccine efficacy at bounds should be checked to see if the evidence is convincing enough to be accepted as a clinically relevant benefit in addition to statistical benefit (efficacy bounds) or a less than relevant benefit for futility bounds.
317+
The vaccine efficacy at bounds should be checked to see if the evidence is convincing enough to be accepted as a clinically relevant benefit in addition to statistical benefit (efficacy bounds) or a less than relevant benefit for futility bounds.
320318

321319
## Checking design properties
322320

@@ -346,7 +344,7 @@ excess_alpha_spend <- matrix(0, nrow = nb$k, ncol=nb$k)
346344
for(i in 1:xb$k){
347345
a <- xb$lower$bound
348346
a[i] <- a[i] + 1
349-
excess_alpha_spend[i,] <-
347+
excess_alpha_spend[i,] <-
350348
cumsum(gsBinomialExact(k = xb$k, theta = xb$theta, n.I = xb$n.I, b= xb$n.I + 1, a = a)$lower$prob[,1])
351349
}
352350
excess_alpha_spend
@@ -372,7 +370,7 @@ excess_beta_spend <- matrix(0, nrow = nb$k - 1, ncol=nb$k)
372370
for(i in 1:(xb$k - 1)){
373371
b <- xb$upper$bound
374372
b[i] <- b[i] - 1
375-
excess_beta_spend[i,] <-
373+
excess_beta_spend[i,] <-
376374
cumsum(as.numeric(gsBinomialExact(k = xb$k, theta = xb$theta, n.I = xb$n.I, b = b, a = xb$lower$bound)$upper$prob[,2]))
377375
}
378376
excess_beta_spend
@@ -463,6 +461,6 @@ We hide the code to produce the table; this is available in package vignette cod
463461
# Summary
464462

465463
We have provided an extended example to show that a @ChanBohidar exact binomial using spending function bounds can be derived in a two-step process that delivers sample size and bounds by 1) deriving a related time-to-event design using asymptotic methods and then 2) converting to an exact binomial design.
466-
Adjustments were made to target Type I and Type II error probabilities in the asymptotic approximation to ensure the exact binomial Type I and Type II error rates were achieved. The method seems a reasonable and straightforward approach to develop a complete design that accounts for the impact of enrollment, failure rates dropout rates, and trial duration.
464+
Adjustments were made to target Type I and Type II error probabilities in the asymptotic approximation to ensure the exact binomial Type I and Type II error rates were achieved. The method seems a reasonable and straightforward approach to develop a complete design that accounts for the impact of enrollment, failure rates dropout rates, and trial duration.
467465

468466
# References

vignettes/binomialSPRTExample.Rmd

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
---
22
title: "Binomial SPRT"
3-
output:
4-
rmarkdown::html_document:
5-
toc: true
6-
toc_float: true
7-
toc_depth: 2
8-
number_sections: true
9-
highlight: "textmate"
3+
output: rmarkdown::html_vignette
104
bibliography: "gsDesign.bib"
115
vignette: >
12-
%\VignetteEngine{knitr::rmarkdown}
136
%\VignetteIndexEntry{Binomial SPRT}
7+
%\VignetteEngine{knitr::rmarkdown}
8+
%\VignetteEncoding{UTF-8}
149
---
1510

1611
```{r, include=FALSE}

0 commit comments

Comments
 (0)