con_permute_all: con_permute_all

Usage Arguments Examples

View source: R/con_permute_all.R

Usage

1
con_permute_all(variable, testdata, top_pm, zoomn, sequence = NULL, method = "kendall", goodtype = "goodpvname", alpha = 0.05, psigalpha = 0.05, initial_fun = con_true_initial, test_fun = con_multitest, exchange_fun = con_exchange, paral = "no")

Arguments

variable
testdata
top_pm
zoomn
sequence
method
goodtype
alpha
psigalpha
initial_fun
test_fun
exchange_fun
paral

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (variable, testdata, top_pm, zoomn, sequence = NULL, 
    method = "kendall", goodtype = "goodpvname", alpha = 0.05, 
    psigalpha = 0.05, initial_fun = con_true_initial, test_fun = con_multitest, 
    exchange_fun = con_exchange, paral = "no") 
{
    trueinitial <- initial_fun(variable = variable, testdata = testdata, 
        top_pm = top_pm, method = method, goodtype = goodtype)
    select <- trueinitial$select
    selname <- trueinitial$selname
    n <- trueinitial$n
    testlevel <- trueinitial$testlevel
    if (is.null(sequence)) {
        sequence <- round(seq(0, n, length.out = 10))
    }
    require(doParallel)
    ncores <- parallel::detectCores()
    cl <- parallel::makeCluster(ncores)
    doParallel::registerDoParallel(cl)
    out <- {
        foreach(k = sequence) %dopar% exchange_fun(k, top_pm = top_pm, 
            n = n, zoomn = zoomn, variable = variable, select = select, 
            selname = selname, testdata = testdata, testlevel = testlevel, 
            alpha = alpha, psigalpha = psigalpha, method = method, 
            test_fun = test_fun, paral = paral)
    }
    parallel::stopCluster(cl)
    out <- do.call(Map, c(f = rbind, out))
    return(list(alldist = out, selname = selname))
  }

LyonsZhang/ProgPermute documentation built on July 22, 2020, 4:09 p.m.