Skip to content

Commit 60d6e9a

Browse files
Merge pull request #464 from yihui/import-once
Import all functions once in `R/gsDesign2-package.R`, and remove the `pkg::` qualifiers
2 parents f73370c + d0ec37f commit 60d6e9a

40 files changed

+82
-147
lines changed

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,11 @@ importFrom(dplyr,summarize)
8181
importFrom(dplyr,ungroup)
8282
importFrom(gsDesign,gsDesign)
8383
importFrom(gsDesign,sfLDOF)
84-
importFrom(mvtnorm,GenzBretz)
8584
importFrom(stats,pnorm)
8685
importFrom(stats,qnorm)
8786
importFrom(stats,setNames)
8887
importFrom(stats,stepfun)
8988
importFrom(stats,uniroot)
90-
importFrom(survival,Surv)
9189
importFrom(tibble,tibble)
9290
importFrom(utils,tail)
9391
useDynLib(gsDesign2, .registration = TRUE)

R/ahr.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272
#' }
7373
#' \if{html}{The contents of this section are shown in PDF user manual only.}
7474
#'
75-
#' @importFrom data.table setDF setDT
76-
#'
7775
#' @export
7876
#'
7977
#' @examples

R/ahr_blinded.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
#' }
6161
#' \if{html}{The contents of this section are shown in PDF user manual only.}
6262
#'
63-
#' @importFrom tibble tibble
64-
#' @importFrom survival Surv
65-
#'
6663
#' @export
6764
#'
6865
#' @examples

R/as_gt.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ as_gt.gs_design <- function(
258258
)
259259

260260
x <- parts$x %>%
261-
dplyr::group_by(Analysis) %>%
261+
group_by(Analysis) %>%
262262
gt::gt() %>%
263263
gt::tab_spanner(
264-
columns = dplyr::all_of(colname_spannersub),
264+
columns = all_of(colname_spannersub),
265265
label = colname_spanner
266266
) %>%
267267
gt::tab_header(title = parts$title, subtitle = parts$subtitle)
@@ -409,7 +409,7 @@ gsd_parts <- function(
409409
)
410410

411411
list(
412-
x = dplyr::arrange(x2, Analysis),
412+
x = arrange(x2, Analysis),
413413
title = title, subtitle = subtitle,
414414
footnote = footnote %||% gsd_footnote(method, columns),
415415
alpha = max(filter(x, Bound == bound[1])[[alpha_column]])

R/check_arg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ check_enroll_rate_fail_rate <- function(enroll_rate, fail_rate) {
255255
if ("stratum" %in% colnames(enroll_rate) && "stratum" %in% colnames(fail_rate)) {
256256
strata_enroll <- unique(enroll_rate$stratum)
257257
strata_fail <- unique(fail_rate$stratum)
258-
strata_common <- dplyr::intersect(strata_enroll, strata_fail)
258+
strata_common <- intersect(strata_enroll, strata_fail)
259259

260260
if (sum(strata_common %in% strata_enroll) != length(strata_enroll)) {
261261
stop("The `Strata` column in the input argument `enroll_rate` and `fail_rate` must be the same!")

R/define.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ define_enroll_rate <- function(
5454
duration,
5555
rate,
5656
stratum = "All") {
57-
df <- tibble::tibble(
57+
df <- tibble(
5858
stratum = stratum,
5959
duration = duration,
6060
rate = rate
@@ -117,7 +117,7 @@ define_fail_rate <- function(
117117
dropout_rate,
118118
hr = 1,
119119
stratum = "All") {
120-
df <- tibble::tibble(
120+
df <- tibble(
121121
stratum = stratum,
122122
duration = duration,
123123
fail_rate = fail_rate,

R/expected_accural.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444
#' }
4545
#' \if{html}{The contents of this section are shown in PDF user manual only.}
4646
#'
47-
#' @importFrom dplyr filter lead
48-
#' @importFrom tibble tibble
49-
#' @importFrom stats stepfun
50-
#'
5147
#' @export
5248
#'
5349
#' @examples

R/expected_time.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
#' }
4646
#' }
4747
#'
48-
#' @importFrom stats uniroot
49-
#'
5048
#' @export
5149
#'
5250
#' @examples

R/fixed_design_ahr.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
#' and `1 - alpha` otherwise).
4040
#' @param study_duration Study duration.
4141
#'
42-
#' @importFrom dplyr filter
43-
#'
4442
#' @returns A list of design characteristic summary.
4543
#'
4644
#' @export
@@ -121,7 +119,7 @@ fixed_design_ahr <- function(
121119
analysis_time = study_duration
122120
)
123121
}
124-
ans <- tibble::tibble(
122+
ans <- tibble(
125123
design = "ahr",
126124
n = d$analysis$n,
127125
event = d$analysis$event,

R/fixed_design_fh.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#' @param rho test parameter in Fleming-Harrington method.
2525
#' @param gamma test parameter in Fleming-Harrington method.
2626
#'
27-
#' @importFrom dplyr filter
28-
#'
2927
#' @export
3028
#'
3129
#' @rdname fixed_design
@@ -120,7 +118,7 @@ fixed_design_fh <- function(
120118
analysis_time = study_duration
121119
)
122120
}
123-
ans <- tibble::tibble(
121+
ans <- tibble(
124122
design = "fh",
125123
n = d$analysis$n,
126124
event = d$analysis$event,

0 commit comments

Comments
 (0)