| as.famset | R Documentation |
Create a set of sets from a binary
matrix where each row of the matrix is taken as one set.
as.famset(m, as.letters = TRUE)
m |
A binary matrix. |
as.letters |
logical, should the elements of the sets be letters or numbers? |
as.famset takes a binary matrix and converts it to a family (i.e.
set) of sets where each row of the matrix represents
one set and a "1" in row i and column j means that element j is contained
in set i.
If as.letters is TRUE the elements of the sets are letters,
otherwise numbers. However, if the matrix has colnames, these are taken
as names for the elements of the sets taking precedence over the
as.letters parameter.
If the matrix contains the same row multiple times it is contained only once in the resulting family of sets.
An R object of class set containing sets..
as.binaryMatrix, set
m <- matrix(c(1, 0, 0, 1, 1, 0), nrow = 2, ncol = 3) m as.famset(m) as.famset(m, as.letters = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.