From 310c87a7d624e5c697bd3f94801bde46d9a9f4c5 Mon Sep 17 00:00:00 2001 From: John Blischak Date: Wed, 29 May 2024 14:01:48 -0400 Subject: [PATCH] Import `nbrOfWorkers()` from {future} into `NAMESPACE` --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/global.R | 4 +++- R/sim_fixed_n.R | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5706390c..183f9757 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: simtrial Type: Package Title: Clinical Trial Simulation -Version: 0.4.1.4 +Version: 0.4.1.5 Authors@R: c( person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")), person("Yujie", "Zhao", email = "yujie.zhao@merck.com", role = c("ctb","cre")), diff --git a/NAMESPACE b/NAMESPACE index e7d91907..eb27c9fe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -38,6 +38,7 @@ importFrom(data.table,setDT) importFrom(data.table,setorderv) importFrom(data.table,uniqueN) importFrom(doFuture,"%dofuture%") +importFrom(future,nbrOfWorkers) importFrom(future,plan) importFrom(methods,is) importFrom(mvtnorm,GenzBretz) diff --git a/R/global.R b/R/global.R index b6146585..0607c1b2 100644 --- a/R/global.R +++ b/R/global.R @@ -18,6 +18,9 @@ # These global variables are declared to eliminate associated R CMD check warnings. # There is no other identified functional impact of these global declarations. +# However, only variables defined in this package should be added to the list. +# If R CMD check warns about undefined global functions or variables that are +# from another package, they need to be added to this package's NAMESPACE. utils::globalVariables( c( @@ -43,7 +46,6 @@ utils::globalVariables( "n_event_tol", "n_risk_tol", "n_risk_trt", - "nbrOfWorkers", "o_minus_e", "one", "origin", diff --git a/R/sim_fixed_n.R b/R/sim_fixed_n.R index 99c76902..fb34a84d 100644 --- a/R/sim_fixed_n.R +++ b/R/sim_fixed_n.R @@ -68,7 +68,7 @@ #' #' @importFrom data.table ":=" rbindlist setDF #' @importFrom doFuture "%dofuture%" -#' @importFrom future plan +#' @importFrom future nbrOfWorkers plan #' @importFrom methods is #' #' @export