MakeLevelArray: Create an array of all factorial combinations of factor...

Description Usage Arguments Value Examples

View source: R/model.R

Description

Take a list storing one or multiple string vectors and glues the strings in these vectors with a dot symbol.

Usage

1

Arguments

x

a list storing one or multiple factor vectors. Each vector can have different numbers of level. For example, f <- list(E = c("nc", "wc"), S = c("n", "w", "pn", "pw"))

Value

a table showing the combinations of factor levels.

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
35
36
37
38
## Example 1
factors <- list(S = c("s1", "s2"))
MakeLevelArray(factors)
##   S
##  s1   s2
## "s1" "s2"

factors <- list(S = c("left", "right"))
MakeLevelArray(factors)
##      S
##   left   right
##  "left" "right"

## Example 2
factors <- list(A = c("00", "45", "90", "135", "180"),
                S = c("mirror", "normal"))
MakeLevelArray(factors)
##       S
## ------------------------------40
##   A        mirror       normal
## ------------------------------40
##  00   "00.mirror"  "00.normal"
##  45   "45.mirror"  "45.normal"
##  90   "90.mirror"  "90.normal"
## 135  "135.mirror" "135.normal"
## 180  "180.mirror" "180.normal"

## Example 3
factors <- list(E = c("nc", "wc"),
                S = c("n", "w", "pn", "pw"))
MakeLevelArray(factors)

##         S
## -------------------------------40
## E       n      w      pn      pw
## -------------------------------40
## nc "nc.n" "nc.w" "nc.pn" "nc.pw"
## wc "wc.n" "wc.w" "wc.pn" "wc.pw"

ggdmc documentation built on Sept. 2, 2018, 1:03 a.m.