Skip to content

Commit

Permalink
Merge pull request #247 from jdblischak/remove-rlang
Browse files Browse the repository at this point in the history
Replace rlang::is_installed() with base::requireNamespace()
  • Loading branch information
nanxstats authored May 7, 2024
2 parents 770a551 + c15e6f3 commit 11fb5e2
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 25 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Imports:
future,
methods,
mvtnorm,
rlang,
stats,
survival,
utils
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ importFrom(future,plan)
importFrom(methods,is)
importFrom(mvtnorm,GenzBretz)
importFrom(mvtnorm,pmvnorm)
importFrom(rlang,is_installed)
importFrom(survival,Surv)
importFrom(survival,is.Surv)
importFrom(survival,survfit)
Expand Down
2 changes: 1 addition & 1 deletion R/get_analysis_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("gsDesign2")
#' @examplesIf requireNamespace("gsDesign2", quietly = TRUE)
#' library(gsDesign2)
#'
#' alpha <- 0.025
Expand Down
2 changes: 1 addition & 1 deletion R/get_cut_date_by_event.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("dplyr")
#' @examplesIf requireNamespace("dplyr", quietly = TRUE)
#' library(dplyr)
#'
#' # Use default enrollment and calendar cut date
Expand Down
2 changes: 1 addition & 1 deletion R/randomize_by_fixed_block.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("dplyr")
#' @examplesIf requireNamespace("dplyr", quietly = TRUE)
#' library(dplyr)
#'
#' # Example 1
Expand Down
2 changes: 1 addition & 1 deletion R/sim_fixed_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("dplyr")
#' @examplesIf requireNamespace("dplyr", quietly = TRUE)
#' library(dplyr)
#' library(future)
#'
Expand Down
2 changes: 1 addition & 1 deletion R/sim_gs_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("gsDesign2")
#' @examplesIf requireNamespace("gsDesign2", quietly = TRUE)
#' library(gsDesign2)
#'
#' # Parameters for enrollment
Expand Down
2 changes: 1 addition & 1 deletion R/sim_pw_surv.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#'
#' @export
#'
#' @examplesIf rlang::is_installed("dplyr")
#' @examplesIf requireNamespace("dplyr", quietly = TRUE)
#' library(dplyr)
#'
#' # Example 1
Expand Down
4 changes: 0 additions & 4 deletions R/simtrial-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ NULL

#' @importFrom Rcpp sourceCpp
NULL

# For safeguarding code examples and tests
#' @importFrom rlang is_installed
NULL
2 changes: 1 addition & 1 deletion R/wlr_weight.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mb <- function(delay = 4, w_max = Inf) {
#' "Designing therapeutic cancer vaccine trials with delayed treatment effect."
#' @export
#'
#' @examplesIf rlang::is_installed("gsDesign2")
#' @examplesIf requireNamespace("gsDesign2", quietly = TRUE)
#' library(gsDesign2)
#'
#' # Example 1: Unstratified ----
Expand Down
2 changes: 1 addition & 1 deletion man/early_zero.Rd

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

2 changes: 1 addition & 1 deletion man/get_analysis_date.Rd

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

2 changes: 1 addition & 1 deletion man/get_cut_date_by_event.Rd

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

2 changes: 1 addition & 1 deletion man/randomize_by_fixed_block.Rd

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

2 changes: 1 addition & 1 deletion man/sim_fixed_n.Rd

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

2 changes: 1 addition & 1 deletion man/sim_gs_n.Rd

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

2 changes: 1 addition & 1 deletion man/sim_pw_surv.Rd

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

3 changes: 2 additions & 1 deletion vignettes/arbitrary-hazard.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ knitr::opts_chunk$set(
out.width = "100%"
)
run <- if (rlang::is_installed(c("dplyr", "ggplot2"))) TRUE else FALSE
run <- requireNamespace("dplyr", quietly = TRUE) &&
requireNamespace("ggplot2", quietly = TRUE)
knitr::opts_chunk$set(eval = run)
```

Expand Down
3 changes: 2 additions & 1 deletion vignettes/maxcombo.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ knitr::opts_chunk$set(
comment = "#>"
)
run <- if (rlang::is_installed(c("dplyr", "gt"))) TRUE else FALSE
run <- requireNamespace("dplyr", quietly = TRUE) &&
requireNamespace("gt", quietly = TRUE)
knitr::opts_chunk$set(eval = run)
```

Expand Down
2 changes: 1 addition & 1 deletion vignettes/modest-wlrt.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(
comment = "#>"
)
run <- if (rlang::is_installed(c("dplyr"))) TRUE else FALSE
run <- requireNamespace("dplyr", quietly = TRUE)
knitr::opts_chunk$set(eval = run)
```

Expand Down
3 changes: 2 additions & 1 deletion vignettes/rmst.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ knitr::opts_chunk$set(
comment = "#>"
)
run <- if (rlang::is_installed(c("gt", "survRM2"))) TRUE else FALSE
run <- requireNamespace("gt", quietly = TRUE) &&
requireNamespace("survRM2", quietly = TRUE)
knitr::opts_chunk$set(eval = run)
```

Expand Down
3 changes: 2 additions & 1 deletion vignettes/routines.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ knitr::opts_chunk$set(
comment = "#>"
)
run <- if (rlang::is_installed(c("dplyr", "gt"))) TRUE else FALSE
run <- requireNamespace("dplyr", quietly = TRUE) &&
requireNamespace("gt", quietly = TRUE)
knitr::opts_chunk$set(eval = run)
```

Expand Down

0 comments on commit 11fb5e2

Please sign in to comment.