Skip to content

Commit

Permalink
suggest/requireNamespace snow, see #44
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lawrence Miller committed Jun 16, 2021
1 parent fcf6121 commit e4b6320
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Suggests:
covr,
progress,
parallel,
snow,
doSNOW,
foreach,
testthat
Expand Down
10 changes: 6 additions & 4 deletions R/bootdht.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@
#' This last option can be extremely time consuming.
#'
#' @section Parallelization:
#' If `cores`>1 then the `foreach`/`doSNOW` packages will be used to run the
#' computation over multiple cores of the computer. It is advised that you do
#' not set `cores` to be greater than one less than the number of cores on your
#' machine.
#' If `cores`>1 then the `foreach`/`snow`/`doSNOW` packages will be used to run
#' the computation over multiple cores of the computer. To use this component
#' you need to install those packages using: `install.packages(c("foreach",
#' "doSNOW", "snow"))` It is advised that you do not set `cores` to be greater
#' than one less than the number of cores on your machine.
#'
#' It is also hard to debug any issues in `summary_fun` so it is best to run a
#' small number of bootstraps first in parallel to check that things work. On
Expand Down Expand Up @@ -281,6 +282,7 @@ bootdht <- function(model,
if(cores > 1){
if (!requireNamespace("foreach", quietly = TRUE) &
!requireNamespace("doSNOW", quietly = TRUE) &
!requireNamespace("snow", quietly = TRUE) &
!requireNamespace("parallel", quietly = TRUE)){
stop("Packages 'parallel', 'foreach' and 'doParallel' need to be installed to use multiple cores.")
}
Expand Down
8 changes: 4 additions & 4 deletions man/bootdht.Rd

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

0 comments on commit e4b6320

Please sign in to comment.