Computes the matrix representation of a knowledge structure.

as.binaryMatrix(x)

Arguments

x

An R object of class kstructure (or kspace).

Details

as.binaryMatrix takes an arbitrary knowledge structure in set representation and computes its matrix form.

Value

An R object of class matrix.

See also

Examples

kst <- kstructure(set(set("a"), set("a","b"), set("a","c"), set("d","e"), set("a","b","d","e"), set("a","c","d","e"), set("a","b","c","d","e"))) as.binaryMatrix(kst)
#> a b c d e #> [1,] 0 0 0 0 0 #> [2,] 1 0 0 0 0 #> [3,] 1 1 0 0 0 #> [4,] 1 0 1 0 0 #> [5,] 0 0 0 1 1 #> [6,] 1 1 0 1 1 #> [7,] 1 0 1 1 1 #> [8,] 1 1 1 1 1