Skip to content

Commit

Permalink
add mapply to parallelCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
miturbide committed Feb 1, 2018
1 parent 72b2b0a commit 23531ca
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
11 changes: 8 additions & 3 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ getRefDates <- function(obj, which = "start") {
#' @export
#' @author J. Bedia

selectPar.pplyFun <- function(parallel.pars, .pplyFUN = c("apply", "lapply", "sapply")) {
.pplyFUN <- match.arg(.pplyFUN, choices = c("apply", "lapply", "sapply"))
selectPar.pplyFun <- function(parallel.pars, .pplyFUN = c("apply", "lapply", "sapply", "mapply")) {
.pplyFUN <- match.arg(.pplyFUN, choices = c("apply", "lapply", "sapply", "mapply"))
if (parallel.pars$hasparallel) {
if (.pplyFUN == "apply") {
fun <- function(...) {
Expand All @@ -397,12 +397,17 @@ selectPar.pplyFun <- function(parallel.pars, .pplyFUN = c("apply", "lapply", "sa
fun <- function(...) {
parallel::parSapply(cl = parallel.pars$cl, ...)
}
} else if (.pplyFUN == "mapply") {
fun <- function(...) {
parallel::clusterMap(cl = parallel.pars$cl, ..., SIMPLIFY = TRUE)
}
}
} else {
fun <- switch(.pplyFUN,
"apply" = apply,
"lapply" = lapply,
"sapply" = sapply)
"sapply" = sapply,
"mapply" = mapply)
}
return(fun)
}
Expand Down
4 changes: 2 additions & 2 deletions man/convert2bin.Rd

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

4 changes: 0 additions & 4 deletions man/dataSplit.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/filterNA.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/makeMultiGrid.Rd

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

3 changes: 2 additions & 1 deletion man/selectPar.pplyFun.Rd

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

0 comments on commit 23531ca

Please sign in to comment.