Skip to content

caugi

1.3.0Package record

Causal Graph Interface

1packages depend
11.3Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Create, query, and modify causal graphs. 'caugi' (Causal Graph Interface) is a causality-first, high performance graph package that provides a simple interface to build, structure, and examine causal relationships.

Changes in 1.3.0

New Features

  • Add enumerate_dags() to enumerate every DAG in the Markov equivalence class of a PDAG, and count_dags() to return the MEC size without materializing every DAG (#297).
  • plot() now automatically bends edges around non-incident nodes that they would otherwise pass straight through, so edges between collinear nodes (e.g. within a tier) and edges crossing unrelated nodes stay visible. This is controlled by edge_style$route (default TRUE); disable it with edge_style = list(route = FALSE), or per edge type/edge via the usual edge_style overrides.
  • Add == and != methods for caugi objects so cg1 == cg2 returns a single logical comparing graph content (class, nodes, edges, simple) rather than session identity.
Show all changes in 1.3.0Hide the rest of the changes in 1.3.0
  • Add first-class "CPDAG" graph class support across the constructor (caugi()), coercion (as_caugi()), and class mutation (mutate_caugi()). Construction validates the full CPDAG invariant (chordal chain components, an acyclic component DAG, Meek closure, and strong arrow protection). generate_graph(class = "CPDAG") now returns a graph with @graph_class = "CPDAG" instead of "MPDAG", the precise label for the essential graph of a Markov equivalence class. Predicates defined on PDAGs and MPDAGs (is_pdag(), is_mpdag(), etc.) continue to accept CPDAGs unchanged.
  • Meek-closed PDAGs are now reported with @graph_class = "MPDAG" instead of "PDAG". This affects the result of meek_closure() and generate_graph(class = "CPDAG"). Predicates and verbs defined on PDAGs (is_pdag(), mutate_caugi(), etc.) continue to accept MPDAGs unchanged.

Improvements

  • aid() is now implemented natively in caugi's Rust backend, removing the external gadjid dependency (and its pinned git revision and vendored sources). Results are unchanged. The AID implementation (src/rust/src/graph/aid.rs) is a derivative of gadjid and is licensed MPL-2.0; the rest of the crate remains MIT. aid() now takes inputs of class "DAG" or "CPDAG" (previously "DAG" or "PDAG").
  • Licensing of bundled code is now declared for CRAN: a top-level LICENSE.note documents the MPL-2.0 component (the AID files derived from gadjid) and the licenses of the vendored Rust crates, and their copyright holders are recorded via cph/ctb roles in Authors@R.
  • adjustment_set(type = "backdoor") now returns an inclusion-minimal backdoor adjustment set, computed in linear time as a minimal d-separator in the proper backdoor graph, rather than the full set of parents of the exposure.
  • The performance vignette is now a true vignette (rather than a pkgdown-only article) and is rebuilt manually from a cross-language harness under tools/benchmark/. The harness compares caugi to igraph, bnlearn, dagitty, ggm, pcalg, pgmpy, and Tetrad on a n ∈ {100, 1000, 10000} grid. The d-separation benchmark now uses a minimal d-separator computed via minimal_separator() (previously used a backdoor adjustment set, which is not in general a d-separating set).

Bug Fixes

  • Fix hd() returning results that depended on the order in which nodes were declared. The Hamming distance now aligns nodes by name before comparing, so logically identical graphs always give the same distance (#323).
  • Fix dag_from_pdag() failing with ` from, edge, to must be equal length. ` when a sink had multiple undirected neighbors (#298).
  • Fixed a bug causing a partially undirected (--o) edges to be plotted as undirected edges.
  • Fix adjustment_set(type = "backdoor") returning an invalid (often empty) set when a parent of the exposure lies on a backdoor path but is not an ancestor of the outcome (#308). The result is now always a valid backdoor adjustment set.
  • Fixed is_mag() returning incorrect results for some ancestral graphs (#309). Adjacency was tested by binary-searching the concatenation of separately sorted neighbor buckets, which is not globally sorted, so some adjacent pairs were missed.
  • Stripped non-build files (tests/, examples/, trybuild fixtures) from the vendored Rust dependencies so no vendored path exceeds 100 characters. This silences pak's "very long paths" warning and avoids installation failures on Windows without long-path support (#319).
  • Fixed to_dot() and to_mermaid() (and write_dot()/write_mermaid()) silently converting partial --o and o-o edges into plain directed edges, dropping the circle endpoints (#307).

Deprecations

  • The first argument of dag_from_pdag() is now named cg, matching the convention used by the rest of the package. The previous name PDAG continues to work as an alias but emits a deprecation warning.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 8.8 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-09-12
  • NOTE12 OK, 1 NOTE2026-07-11
  • OK13 OK2026-05-02
  • NOTE11 OK, 1 NOTE2026-04-25
  • OK14 OK2026-04-16
Show 2 earlier changesHide 2 earlier changes
  • NOTE13 OK, 1 NOTE2026-03-28
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.3.0
READMEYes · 545 wordsVignettesYes · 7 · dynamicNEWSYes · 100% structured · mentions 1.3.0Citation fileNoWebsiteYes · pkgdown
Help pages
139 (40 internal)includes a package overview page
Examples that run
100%89 run in a plain check
Exported functions with examples
93%
Documented parameters
93%
Return-value docs
100%
Help pages citing references
7%

Downloads

11.3K
CRAN downloads in the past year
Rank #6,157 · ~31/day · ~938/mo
Daily download trend is not available in this view yet.
42930 days
1.4K90 days
11.3K1 year
Compare downloads with other packages →
Also on352 r2u

Repository

16Stars
3Forks
17Open issues
3Open PRs
4Releases
1,153Commits
7Commit identities
1,153 commits · Last activity 2026-10-16 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
90%
Median days to close, 50 most recently updated closed issues
7
Median days to close, 50 most recently updated closed PRs
6

Stars over time

2025-10-12 · 22026-07-07 · 16
PracticesBeta

14 development-tooling and community-health practices detected across 7 families in the upstream repository

Checks run against github.com/frederikfabriciusbjerre/caugi on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Contributing guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-16 · The repository has a site deploy workflow

pkgdown site last built 2026-10-16

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 3 practices
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Automation and maintenance (1)
Dependabot
Lint, format, editor (3)
Lint workflowAirRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2025-10-20
    Seen in the repository: .github/instructions
    Pull request: opened by its own account
    Commits: 37 by its own account
  • Cursorfirst seen 2026-01-15
    Named in .gitignore: .cursor
  • Claude Codefirst seen 2026-04-29
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 8 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
Models named in its commits
  • Claude Opus 4.86 commits · Jun to Sep 2026
  • Claude Opus 52 commits · Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
17 external dependencies (excludes base and recommended)

Installing caugi adds 2 packages (2 with compiled code, 5.9 MB of source tarballs). Heaviest: data.table 5.7 MB, S7 180 KB.

Depends (1)
R >= 4.2
Imports (5)
data.tablegridS7statsmethods
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Depends, Imports or LinkingTo, most downloaded first

People & History

People (8)
Author, Maintainer since 0.3.1 (2025), Copyright holder
Author · added in 1.1.0
Contributor, Copyright holder · added in 1.3.0
vendored under src/rust/vendor; see LICENSE.note
Contributor, Copyright holder · added in 1.3.0
author of the 'gadjid' crate, from which src/rust/src/graph/aid.rs is derived (MPL-2.0); see LICENSE.note
Contributor, Copyright holder · added in 1.3.0
author of the 'gadjid' crate; see LICENSE.note
Contributor, Copyright holder
author of the 'gadjid' crate; see LICENSE.note
Releases (5)

Pick two releases to compare their code metrics.

  • 1.3.0Latest
    record
    2026-09-09 · current release · diff ↗ ·
    removed 2 exports
    plot, print
    added 2 exports
    count_dags, enumerate_dags
  • 1.2.0
    record
    2026-05-05 · diff ↗ ·
    added 3 exports
    caugi_layout_circle, list_caugi_edges, minimal_separator
  • R
    R 4.6.0 released · 2026-04-24
  • 1.1.0
    record
    2026-03-20 · diff ↗ ·
    added 8 exports
    compare_proxy.caugi::caugi, dag_from_pdag, is_mpdag, is_simple, meek_closure, minimal_d_separator, normalize_latent_structure, posteriors
  • 1.0.0
    record
    2026-01-22 · diff ↗ ·
    added 39 exports
    all_adjustment_sets_admg, anteriors, caugi_default_options, caugi_deserialize, caugi_dot, caugi_export, caugi_graphml, caugi_layout, caugi_layout_bipartite, caugi_layout_fruchterman_reingold, caugi_layout_kamada_kawai, caugi_layout_sugiyama, caugi_layout_tiered, caugi_mermaid, caugi_options, caugi_plot, caugi_serialize, condition_marginalize, districts, exogenize, is_admg, is_ag, is_mag, is_valid_adjustment_admg, latent_project, m_separated, plot, read_caugi, read_graphml, simulate_data and 9 more
  • 0.3.1
    record
    2025-12-04
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-12-04
Total releases
5 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.2
Download size
3.5 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("caugi")
Fabricius-Bjerre, F., Authors of the bundled Rust crates, Henckel, L., Kristensen, B. H., Larsson, J., Sachs, M., Weichwald, S., & Würtzen, T. (2026). caugi: Causal Graph Interface (Version 1.3.0) [Computer software]. https://doi.org/10.32614/CRAN.package.caugi

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for caugi version 1.3.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy