fac2list:

Usage Arguments Examples

Usage

1
fac2list(x, g)

Arguments

x
g

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
##---- 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, g) 
{
    g = as.data.frame(g)
    L = ncol(g)
    g = listm(g)
    for (j in 1:L) g[[j]] = as.factor(g[[j]])
    g = matl(g)
    Lp1 = L + 1
    if (L > 4) 
        stop("Can have at most 4 factors")
    if (L == 1) {
        res = selby(cbind(x, g), 2, 1)
        group.id = res$grpn
        res = res$x
    }
    if (L > 1) {
        res = selby2(cbind(x, g), c(2:Lp1), 1)
        group.id = res$grpn
        res = res$x
    }
    print("Group Levels:")
    print(group.id)
    res
  }

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