ConceptSet {fcaR} | R Documentation |
R6 class for a set of concepts
Description
This class implements the data structure and methods for concept sets.
Methods
Public methods
Method new()
Create a new ConceptLattice
object.
Usage
ConceptSet$new(extents, intents, objects, attributes, I = NULL)
Arguments
extents
(
dgCMatrix
) The extents of all conceptsintents
(
dgCMatrix
) The intents of all conceptsobjects
(character vector) Names of the objects in the formal context
attributes
(character vector) Names of the attributes in the formal context
I
(
dgCMatrix
) The matrix of the formal context
Returns
A new ConceptLattice
object.
Method size()
Size of the Lattice
Usage
ConceptSet$size()
Returns
The number of concepts in the lattice.
Method is_empty()
Is the lattice empty?
Usage
ConceptSet$is_empty()
Returns
TRUE
if the lattice has no concepts.
Method extents()
Concept Extents
Usage
ConceptSet$extents()
Returns
The extents of all concepts, as a dgCMatrix
.
Method intents()
Concept Intents
Usage
ConceptSet$intents()
Returns
The intents of all concepts, as a dgCMatrix
.
Method print()
Print the Concept Set
Usage
ConceptSet$print()
Returns
Nothing, just prints the concepts
Method to_latex()
Write in LaTeX
Usage
ConceptSet$to_latex(print = TRUE, ncols = 1, numbered = TRUE, align = TRUE)
Arguments
print
(logical) Print to output?
ncols
(integer) Number of columns of the output.
numbered
(logical) Number the concepts?
align
(logical) Align objects and attributes independently?
Returns
The LaTeX
code to list all concepts.
Method to_list()
Returns a list with all the concepts
Usage
ConceptSet$to_list()
Returns
A list of concepts.
Method [()
Subsets a ConceptSet
Usage
ConceptSet$[(indices)
Arguments
indices
(numeric or logical vector) The indices of the concepts to return as a list of Concepts. It can be a vector of logicals where
TRUE
elements are to be retained.
Returns
Another ConceptSet.
Method sub()
Individual Concepts
Usage
ConceptSet$sub(index)
Arguments
index
(numeric) The index of the concept to return.
Returns
The Concept.
Method support()
Get support of each concept
Usage
ConceptSet$support()
Returns
A vector with the support of each concept.
Method clone()
The objects of this class are cloneable with this method.
Usage
ConceptSet$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
# Build a formal context
fc_planets <- FormalContext$new(planets)
# Find the concepts
fc_planets$find_concepts()
# Find join- and meet- irreducible elements
fc_planets$concepts$join_irreducibles()
fc_planets$concepts$meet_irreducibles()