ConceptLattice | R Documentation |
This class implements the data structure and methods for concept lattices.
fcaR::ConceptSet
-> ConceptLattice
new()
Create a new ConceptLattice
object.
ConceptLattice$new(extents, intents, objects, attributes, I = NULL)
extents
(dgCMatrix
) The extents of all concepts
intents
(dgCMatrix
) The intents of all concepts
objects
(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
A new ConceptLattice
object.
plot()
Plot the concept lattice
ConceptLattice$plot(object_names = TRUE, to_latex = FALSE, ...)
object_names
(logical) If TRUE
, plot object names, otherwise omit them from the diagram.
to_latex
(logical) If TRUE
, export the plot as a tikzpicture
environment that can be included in a LaTeX
file.
...
Other parameters to be passed to the tikzDevice
that renders the lattice in LaTeX
, or for the figure caption. See Details
.
Particular parameters that control the size of the tikz
output are: width
, height
(both in inches), and pointsize
(in points), that should be set to the font size used in the documentclass
header in the LaTeX
file where the code is to be inserted.
If a caption
is provided, the whole tikz
picture will be wrapped by a figure
environment and the caption set.
If to_latex
is FALSE
, it returns nothing, just plots the graph of the concept lattice. Otherwise, this function returns the LaTeX
code to reproduce the concept lattice.
sublattice()
Sublattice
ConceptLattice$sublattice(...)
...
See Details.
As argument, one can provide both integer indices or Concepts
, separated by commas. The corresponding concepts are used to generate a sublattice.
The generated sublattice as a new ConceptLattice
object.
top()
Top of a Lattice
ConceptLattice$top()
The top of the Concept Lattice
fc <- FormalContext$new(planets) fc$find_concepts() fc$concepts$top()
bottom()
Bottom of a Lattice
ConceptLattice$bottom()
The bottom of the Concept Lattice
fc <- FormalContext$new(planets) fc$find_concepts() fc$concepts$bottom()
join_irreducibles()
Join-irreducible Elements
ConceptLattice$join_irreducibles()
The join-irreducible elements in the concept lattice.
meet_irreducibles()
Meet-irreducible Elements
ConceptLattice$meet_irreducibles()
The meet-irreducible elements in the concept lattice.
decompose()
Decompose a concept as the supremum of meet-irreducible concepts
ConceptLattice$decompose(C)
C
A list of Concept
s
A list, each field is the set of meet-irreducible elements whose supremum is the corresponding element in C
.
supremum()
Supremum of Concepts
ConceptLattice$supremum(...)
...
See Details.
As argument, one can provide both integer indices or Concepts
, separated by commas. The corresponding concepts are used to compute their supremum in the lattice.
The supremum of the list of concepts.
infimum()
Infimum of Concepts
ConceptLattice$infimum(...)
...
See Details.
As argument, one can provide both integer indices or Concepts
, separated by commas. The corresponding concepts are used to compute their infimum in the lattice.
The infimum of the list of concepts.
subconcepts()
Subconcepts of a Concept
ConceptLattice$subconcepts(C)
C
(numeric or SparseConcept
) The concept to which determine all its subconcepts.
A list with the subconcepts.
superconcepts()
Superconcepts of a Concept
ConceptLattice$superconcepts(C)
C
(numeric or SparseConcept
) The concept to which determine all its superconcepts.
A list with the superconcepts.
lower_neighbours()
Lower Neighbours of a Concept
ConceptLattice$lower_neighbours(C)
C
(SparseConcept
) The concept to which find its lower neighbours
A list with the lower neighbours of C
.
upper_neighbours()
Upper Neighbours of a Concept
ConceptLattice$upper_neighbours(C)
C
(SparseConcept
) The concept to which find its upper neighbours
A list with the upper neighbours of C
.
clone()
The objects of this class are cloneable with this method.
ConceptLattice$clone(deep = FALSE)
deep
Whether to make a deep clone.
# 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()
# Get concept support
fc_planets$concepts$support()
## ------------------------------------------------
## Method `ConceptLattice$top`
## ------------------------------------------------
fc <- FormalContext$new(planets)
fc$find_concepts()
fc$concepts$top()
## ------------------------------------------------
## Method `ConceptLattice$bottom`
## ------------------------------------------------
fc <- FormalContext$new(planets)
fc$find_concepts()
fc$concepts$bottom()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.