diff --git a/DESCRIPTION b/DESCRIPTION index e1aa65a..ca9c327 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,13 +7,13 @@ Author: Andre Chalom, Paulo Inacio Knegt Lopez de Prado Maintainer: Andre Chalom Depends: R (>= 3.0.1), - Hmisc, - boot, - parallel + Hmisc Imports: utils, graphics, - stats + stats, + boot, + parallel Suggests: sensitivity, mcmc diff --git a/NAMESPACE b/NAMESPACE index 5f84bd1..51f77fe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,6 @@ # Required packages: importFrom(Hmisc, Ecdf) -import(graphics, stats, parallel) +import(graphics, stats) # Loads the correlation correction code from C useDynLib(pse, corcorr) # Exporting the S3 objects and methods diff --git a/R/cluster.R b/R/cluster.R index 0f5b721..075f082 100644 --- a/R/cluster.R +++ b/R/cluster.R @@ -10,8 +10,8 @@ machinefile <- function(name) { clusterRun <- function (cl, model, L) { N <- dim(L)[1] - sp <- clusterSplit(cl, 1:N) - tmp.res <- clusterApply(cl, sp, + sp <- parallel::clusterSplit(cl, 1:N) + tmp.res <- parallel::clusterApply(cl, sp, fun = function(idx, x) model(x[idx,]), L) n.outs <- length(unlist(tmp.res))/N res <- array( dim=c(N, n.outs)); diff --git a/R/external.R b/R/external.R index 1ea2530..5a006e5 100644 --- a/R/external.R +++ b/R/external.R @@ -167,7 +167,7 @@ pcc.default <- function(X, y=NULL, rank = FALSE, nboot = 0, conf = 0.95, ...) { pcc <- data.frame(original = estim.pcc(data)) rownames(pcc) <- colnames(X) } else { - boot.pcc <- boot(data, estim.pcc, R = nboot) + boot.pcc <- boot::boot(data, estim.pcc, R = nboot) pcc <- bootstats(boot.pcc, conf, "basic") rownames(pcc) <- colnames(X) } diff --git a/R/pic.R b/R/pic.R index eb98325..65ce04a 100644 --- a/R/pic.R +++ b/R/pic.R @@ -29,7 +29,7 @@ pic.default <- function (X, y, nboot = 0, conf=0.95, ...) { pic <- data.frame(original=estim.pic(data)) rownames(pic) <- colnames(X) } else { - boot.pic <- boot(data, estim.pic, R = nboot) + boot.pic <- boot::boot(data, estim.pic, R = nboot) pic <- bootstats(boot.pic, conf, "basic") rownames(pic) <- colnames(X) } diff --git a/man/LHS.Rd b/man/LHS.Rd index 5e2562b..e705d1f 100644 --- a/man/LHS.Rd +++ b/man/LHS.Rd @@ -107,8 +107,7 @@ incompleteLHS <- LHS(factors=5, N=30) incompleteLHS <- tell(incompleteLHS, seq(1,30)) \dontrun{ - library(parallel) - new.cluster = makePSOCKcluster(c("localhost", "localhost")) + new.cluster <- parallel::makePSOCKcluster(c("localhost", "localhost")) clusterLHS <- LHS(model=function(x) x[,1]/x[,2], factors=2, N=100, cl = new.cluster) stopCluster(new.cluster) }