ncx <- detectCores()
cl <- makeCluster(ncx)
detect_outlier <- function(nvec, cl, ncx){
tot <- length(nvec)
eachN <- ceiling(tot/ncx)
ninjar::print_stamp("splitting vector")
pll_vec <- parallel::clusterSplit(cl, nvec)
ninjar::print_stamp("Calculating...")
clusterApply(cl, pll_vec, quantile)
}
nvec <- rnorm(100000000)
ninjar::RunTimer(quantile(nvec))
ninjar::RunTimer(detect_outlier(nvec, cl, ncx))
stopCluster(cl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.