New Functionality:
calculate_arrow_relations() method to FormalContext to compute the arrow relations ($\swarrow$, $\nearrow$, $\updownarrow$) of a binary formal context using a high-performance C++ implementation based on bitsets.FormalContext for advanced structural analysis based on arrow relations:
is_distributive(): Efficiently check if the concept lattice is distributive without computing it.get_irreducible_objects() / get_irreducible_attributes(): Identify the core elements needed to reconstruct the lattice.get_core(): Extract the smallest context that generates the same lattice.reduce_arrows() to FormalContext. This method clarifies and reduces a context using arrow relations, which is significantly faster than traditional methods for large contexts.balance_grades algorithm to improve visual symmetry in Hasse diagrams (e.g., for $N_5$).viewer = "base" to plot(), providing a lightweight alternative to ggraph with support for themes ("standard", "nord", "vibrant", "latex").Improvements:
standardize() and reduce(): These methods now use reduce_arrows() internally, removing the dependency on pre-calculating the concept lattice and improving performance while preserving original labels.calculate_lattice_layout_rcpp to support numeric (decimal) Y coordinates for smooth vertical positioning..print_arrows() to handle symbol mapping for both CLI (Unicode) and LaTeX output.lattice_properties vignette with a detailed section on arrow relations.test-arrow_relations.R and test-arrow_advanced.R with comprehensive unit tests.New Functionality:
guesswho dataset, based on the classic board game, containing 24 characters and their binary attributes. Ideal for demonstrating concept lattices and implications in binary contexts.bonds() function and BondLattice class to compute and analyze the bonds between two formal contexts.
"conexp" (default, implication-based) and "mcis" (backtracking over pre-computed concepts).BondLattice class provides 10 similarity and complexity metrics via the similarity() method: "log-bond", "top-density", "complexity", "core-agreement", "entropy", "stability", "width", "dimension", "width-index", and "dimension-index".width() method to ConceptLattice and BondLattice, computing the maximum antichain size via an efficient C++ implementation.dimension() method to ConceptLattice and BondLattice, computing a heuristic estimate of the order dimension via C++.Improvements:
FastBitset class used internally by LinCbO and other translation units.bonds vignette in English, explaining the theory and usage of bonds, metrics, and visualization.test-bonds.R). Also added test-coverage_sniper.R for general edge cases.Improvements:
ImplicationSet now inherits from RuleSet, following proper object-oriented design. Shared methods (filtering, subsetting, printing, serialization, etc.) live in the parent RuleSet class, eliminating ~600 lines of duplicated code. ImplicationSet retains only FCA-specific methods (closure(), apply_rules(), to_basis(), to_direct_optimal(), etc.).dplyr verbs (filter(), arrange(), slice()) now work on RuleSet objects in addition to ImplicationSet, via S3 method dispatch.get_standard_context() method to ImplicationSet, which computes the standard formal context from a set of implications by finding the meet-irreducible closed sets.LinCbO, achieving performance improvements of up to 100x compared to NextClosure.to_direct_optimal() method now automatically detects binary contexts and routes the computation to these optimized native routines.New Functionality:
find_protoconcepts() method to FormalContext to compute protoconcepts (pairs $(A, B)$ such that $A' = B''$) using an efficient C++ implementation.to_json() methods and corresponding *_from_json() functions for FormalContext, ConceptLattice, ImplicationSet, and RuleSet. This allows for efficient serialization of all major data structures in fcaR, including recursive export of nested objects.Major Enhancements:
dplyr verbs, allowing for a fluent, grammar-based manipulation of FCA objects:
select() (attributes), filter() (objects), mutate() (feature engineering), arrange() (sorting), and rename(). Includes support for tidyselect helpers (e.g., starts_with()).filter() (based on metrics or attributes), arrange() (sorting rules), and slice() (subsetting by index).ImplicationSet filtering to query rules based on attribute presence/absence: lhs(), rhs(), not_lhs(), lhs_any(), etc. This allows querying rules like filter(rhs("Attribute_A"), support > 0.2).find_causal_rules() method in FormalContext, enabling the discovery of causal rules by controlling for confounding variables using the "Fair Odds Ratio" on matched pairs.Improvements:
subcontext() method in FormalContext. It now robustly handles negative indices, logical vectors, and character vectors, and prevents dimension collapsing issues (using drop = FALSE) that previously caused errors with the Matrix package.[ and related methods of ImplicationSet. These ensure that critical context metadata (such as the number of objects $N$ for support calculation) is preserved when filtering or sorting rules, fixing previous issues where metadata was lost.dplyr attributes.Documentation:
fcaR_dplyr vignette illustrating the new data manipulation workflow.causal vignette explaining the new causal mining functionality and its application to Simpson's Paradox.Fixes:
Matrix coercion errors (dgCMatrix to data.frame) in R 4.x when using internal incidence matrices.fixupDN.if.valid errors from the Matrix package when filtering operations resulted in empty contexts (0 objects or 0 attributes).ggplot2, ggraph, igraph, rstudioapi, and yaml to Suggests.forcats and magrittr dependencies by using base R equivalents and the native pipe |>.Major Enhancements:
factorize() method to FormalContext class. It now implements two state-of-the-art algorithms:
RandomContext(): Generates synthetic contexts using Uniform or Dirichlet distributions (mimicking real-world data structure).randomize_context(): Randomizes existing contexts via Edge swapping (preserves marginal sums) or Rewiring (preserves density).RandomDistributiveContext() to generate synthetic data guaranteed to produce distributive lattices (based on Birkhoff's theorem).New Functionality:
stability(), separation(), and fuzzy_density() to ConceptLattice to compute concept quality metrics.ConceptLattice to efficiently check algebraic properties using sparse matrix operations: is_distributive(), is_modular(), is_semimodular(), and is_atomic().find_concepts(): "InClose" (default), "FastCbO", or "NextClosure".to_direct_optimal() to convert implication sets into the direct optimal basis.use_hedge() and get_hedge() to manage hedges in fuzzy implication closures.Improvements:
hasseDiagram. Implemented a new native graphics engine for concept lattices.advanced_lattice_metrics, creating_contexts, fuzzy_fca, lattice_visualization, matrix_factorization, random_contexts and lattice_properties.Enhancements:
fc$scale() function admits a new argument bg (default: FALSE) which, if set to TRUE, avoids computing the background knowledge of the scales.Fixes:
Enhancements:
fc$use_logic() to select one of the available_logics().Bugfixes:
Enhancements:
New functionality:
Bugfixes:
Enhancements:
New functionality:
%&% and %|% that compute the intersection (logical and) and the union (or operation) on Sets.Breaking changes:
Bugfixes:
Bugfixes:
Enhancements:
Bugfixes:
Bugfixes:
Enhancements:
Bugfixes:
Enhancements:
Made changes suggested by CRAN:
Updated vignettes
NEWS.md file to track changes to the package.