Skip to contents

Appends a phenomenon, a robust empirical regularity, and a provenance entry. R does not change the theory in place, so assign the result.

Usage

tf_add_phenomenon(theory, id, statement, claim = NULL, source_doi = NULL)

Arguments

theory

A theory object (named list).

id

The phenomenon's identifier.

statement

The regularity in words.

claim

Optional machine-readable claim, as for tf_add_prediction(), which tf_entailments() reads against the causal graph.

source_doi

Optional DOI of the work that establishes it.

Value

The theory with the phenomenon added.

Examples

tf_theory("demo-1", "A demonstration theory") |>
  tf_add_phenomenon("ph1", "Arousal and avoidance covary.",
                    claim = list(kind = "association", x = "c_arousal",
                                 y = "c_avoidance", sign = "positive"))
#> $schema_version
#> [1] "1.1"
#> 
#> $id
#> [1] "demo-1"
#> 
#> $title
#> [1] "A demonstration theory"
#> 
#> $maturity
#> [1] "building"
#> 
#> $theory_form
#> [1] "network"
#> 
#> $provenance
#> $provenance[[1]]
#> $provenance[[1]]$step
#> [1] "1"
#> 
#> $provenance[[1]]$action
#> [1] "tf_theory"
#> 
#> $provenance[[1]]$detail
#> [1] "demo-1"
#> 
#> 
#> $provenance[[2]]
#> $provenance[[2]]$step
#> [1] "2"
#> 
#> $provenance[[2]]$action
#> [1] "tf_add_phenomenon"
#> 
#> $provenance[[2]]$detail
#> [1] "ph1"
#> 
#> 
#> 
#> $phenomena
#> $phenomena[[1]]
#> $phenomena[[1]]$id
#> [1] "ph1"
#> 
#> $phenomena[[1]]$statement
#> [1] "Arousal and avoidance covary."
#> 
#> $phenomena[[1]]$claim
#> $phenomena[[1]]$claim$kind
#> [1] "association"
#> 
#> $phenomena[[1]]$claim$x
#> [1] "c_arousal"
#> 
#> $phenomena[[1]]$claim$y
#> [1] "c_avoidance"
#> 
#> $phenomena[[1]]$claim$sign
#> [1] "positive"
#> 
#> 
#> 
#>