Skip to content

Identification of Counterfactual Queries in Causal Models

1packages depend
3.6Kdownloads / year
97.0%test coverage
13/13flavors OK

Overview

About

Facilitates the identification of counterfactual queries in structural causal models via the ID* and IDC* algorithms by Shpitser, I. and Pearl, J. (2007, 2008) doi:10.48550/arXiv.1206.5294, https://jmlr.org/papers/v9/shpitser08a.html. Provides a simple interface for defining causal diagrams and counterfactual conjunctions. Construction of parallel worlds graphs and counterfactual graphs is carried out automatically based on the counterfactual query and the causal diagram. See Tikka, S. (2023) doi:10.32614/RJ-2023-053 for a tutorial of the package.

Changes in 0.1.8
  • Fixed an issue where some identifiable queries were incorrectly deemed nonidentifiable when multiple counterfactual variables shared a compatible subscript.
  • Updated igraph related functionality to use non-deprecated functions.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 1.4 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.1.8
README· In the repository, left out of the releaseVignettesNoNEWSYes · 100% structured · mentions 0.1.8Citation fileNoWebsitenot declared in DESCRIPTION
Description cites an R Journal article
Help pages
10includes a package overview page
Examples that run
100%4 run in a plain check
Exported functions with examples
50%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
10%

Downloads

3.6K
CRAN downloads in the past year
Rank #9,925 · ~10/day · ~304/mo
Daily download trend is not available in this view yet.
38630 days
1K90 days
3.6K1 year
Compare downloads with other packages →
Also on129 r2u7 autocran29 c2d4u

Repository

11Stars
1Forks
0Open issues
0Open PRs
0Releases
60Commits
2Commit identities
counterfactualcounterfactualsidentifiabilitycausal-modelscausal-inferencecausality-algorithmsdirected-acyclic-graph
License file reads as GPL-3.0 · 60 commits · Last activity 2025-11-21 · Default branch at 0.1.9, ahead of CRAN 0.1.8 (checked 2026-10-22)
Responsiveness
not measured
PracticesBeta

5 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/santikka/cfid on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

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

Docs source (1)
README.Rmd
Coverage (1)
Coverage reporting (Codecov)
Research and citation (1)
codemeta.json
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing cfid adds no packages beyond those that come with R.

Depends (0)
none
Imports (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Depends, Imports or LinkingTo, most downloaded first

People & History

People (1)
Author, Maintainer since 0.1.2 (2021)
Releases (5)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.8Latest
    record
    2025-10-27 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.1.7
    record
    2023-11-27 · diff ↗
  • 0.1.6
    record
    2023-11-13 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.1.4
    record
    2022-10-26 · diff ↗ ·
    removed 3 exports
    CounterfactualConjunction, CounterfactualVariable, Probability
    added 5 exports
    causal_effect, counterfactual_conjunction, counterfactual_variable, functional, probability
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.2
    record
    2021-06-10
  • R
    R 4.1.0 released · 2021-05-18

Package metadata

First published
2021-06-10
Total releases
5 / 5 yrs
License
GPL (>= 3) OSI
Download size
39 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("cfid")
Tikka, S. (2025). cfid: Identification of Counterfactual Queries in Causal Models (Version 0.1.8) [Computer software]. https://doi.org/10.32614/CRAN.package.cfid

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 cfid version 0.1.8 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, 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