Ppca.summary:

Usage Arguments Examples

Usage

1
Ppca.summary(x, MC = FALSE, SCALE = TRUE, p = NULL)

Arguments

x
MC
SCALE
p

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
##---- 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 (x, MC = FALSE, SCALE = TRUE, p = NULL) 
{
    x = as.matrix(x)
    if (!is.matrix(x)) 
        stop("x should be a matrix")
    x = elimna(x)
    gv = NA
    if (is.null(p)) 
        p = ncol(x)
    if (!MC) 
        for (j in 1:p) gv[j] = Ppca(x, p = j, pr = FALSE, SCALE = SCALE)$gen.sd
    if (MC) {
        library(parallel)
        y = list()
        for (j in 1:p) y[[j]] = j
        gv = mclapply(y, Ppca.sum.sub, x, SCALE = SCALE, mc.preschedule = TRUE)
        gv = as.vector(matl(gv))
    }
    res = matrix(NA, nrow = 3, ncol = p)
    res[1, ] = c(1:p)
    res[2, ] = gv
    res[3, ] = gv/max(gv)
    dimnames(res) = list(c("Num. of Comp.", "Gen.Stand.Dev", 
        "Relative Size"), NULL)
    list(summary = res)
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.