Fast pattern

fast.pattern(x, y, categories = 2, ...)

Arguments

x

Matrix (binary) of patterns. Optionally if y is also passed as argument, then the pattern matrix is defined as the elements agreeing in the two matrices.

y

Optional matrix argument with same dimensions as x (see above)

categories

Default 2 (binary)

...

Optional additional arguments

Author

Klaus K. Holst

Examples

X <- matrix(rbinom(100,1,0.5),ncol=4)
fast.pattern(X)
#> $pattern
#>       [,1] [,2] [,3] [,4]
#>  [1,]    1    0    1    1
#>  [2,]    0    0    1    1
#>  [3,]    0    0    0    0
#>  [4,]    1    0    1    0
#>  [5,]    0    1    0    0
#>  [6,]    0    1    0    1
#>  [7,]    1    1    0    1
#>  [8,]    1    0    0    0
#>  [9,]    1    0    0    1
#> [10,]    1    1    1    0
#> [11,]    1    1    1    1
#> [12,]    0    1    1    0
#> 
#> $group
#>       [,1]
#>  [1,]    0
#>  [2,]    1
#>  [3,]    2
#>  [4,]    3
#>  [5,]    4
#>  [6,]    5
#>  [7,]    0
#>  [8,]    6
#>  [9,]    0
#> [10,]    2
#> [11,]    7
#> [12,]    4
#> [13,]    7
#> [14,]    8
#> [15,]    9
#> [16,]    3
#> [17,]   10
#> [18,]    0
#> [19,]    4
#> [20,]    2
#> [21,]    3
#> [22,]    0
#> [23,]   11
#> [24,]    6
#> [25,]    2
#> 

X <- matrix(rbinom(100,3,0.5),ncol=4)
fast.pattern(X,categories=4)
#> $pattern
#>       [,1] [,2] [,3] [,4]
#>  [1,]    1    1    2    1
#>  [2,]    2    2    3    1
#>  [3,]    2    1    1    2
#>  [4,]    0    2    1    2
#>  [5,]    0    0    3    1
#>  [6,]    2    1    2    1
#>  [7,]    3    1    3    2
#>  [8,]    2    1    1    3
#>  [9,]    2    3    2    0
#> [10,]    2    1    2    2
#> [11,]    3    2    3    3
#> [12,]    2    3    2    2
#> [13,]    2    0    1    2
#> [14,]    1    1    0    3
#> [15,]    1    2    3    3
#> [16,]    2    1    1    1
#> [17,]    1    2    2    1
#> [18,]    1    2    0    1
#> [19,]    2    2    2    1
#> [20,]    0    1    1    2
#> [21,]    2    1    2    3
#> [22,]    2    3    1    2
#> [23,]    2    2    1    1
#> [24,]    1    2    2    0
#> 
#> $group
#>       [,1]
#>  [1,]    0
#>  [2,]    1
#>  [3,]    2
#>  [4,]    3
#>  [5,]    4
#>  [6,]    5
#>  [7,]    6
#>  [8,]    7
#>  [9,]    8
#> [10,]    9
#> [11,]   10
#> [12,]   11
#> [13,]    5
#> [14,]   12
#> [15,]   13
#> [16,]   14
#> [17,]   15
#> [18,]   16
#> [19,]   17
#> [20,]   18
#> [21,]   19
#> [22,]   20
#> [23,]   21
#> [24,]   22
#> [25,]   23
#>