Skip to contents

Appends an evidence entry and a provenance entry. R does not change the theory in place, so assign the result.

Usage

tf_add_evidence(theory, supports, direction, source_doi = NULL)

Arguments

theory

A theory object (named list).

supports

The id of the prediction the evidence bears on.

direction

One of "corroborates", "refutes" or "mixed".

source_doi

Optional DOI of the work, stored as null when not given.

Value

The theory with the evidence added.

Examples

tf_theory("demo-1", "A demonstration theory") |>
  tf_add_evidence("h1", "corroborates", source_doi = "10.1037/0033-295X.94.2.115")
#> $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_evidence"
#> 
#> $provenance[[2]]$detail
#> [1] "h1"
#> 
#> 
#> 
#> $evidence
#> $evidence[[1]]
#> $evidence[[1]]$supports
#> [1] "h1"
#> 
#> $evidence[[1]]$source_doi
#> [1] "10.1037/0033-295X.94.2.115"
#> 
#> $evidence[[1]]$direction
#> [1] "corroborates"
#> 
#> 
#>