
Augment a base DAG with edges from a Knowledge Graph
Source:R/causal_augment.R
causal_augment_dag.RdTakes a dagitty DAG expressing prior / expert structural
knowledge (e.g. the CLORPT or Cerrado DAGs shipped with edaphos)
and unions it with the subset of Knowledge-Graph edges whose
confidence is at least min_confidence. Duplicate edges are
dropped silently, and any edge whose insertion would introduce a
directed cycle is rejected (warned but not inserted), so the
returned DAG is guaranteed to be acyclic and usable for
causal_adjustment_set().
Arguments
- base_dag
A
dagittyDAG (e.g.causal_cerrado_dag()).- kg
An
edaphos_causal_kg(fromcausal_kg_new()/ LLM ingestion).- min_confidence
Numeric in
[0, 1]; KG edges strictly below this threshold are ignored.- allow_new_nodes
Logical. When
TRUE(default) nodes appearing only in the KG are added to the augmented DAG. WhenFALSEKG edges touching unseen nodes are dropped — useful when the analyst wants to lock the structural vocabulary.