Skip to contents

Appends a registered alternative account and a provenance entry. R does not change the theory in place, so assign the result.

Usage

tf_add_alternative(
  theory,
  id,
  label,
  key_constructs = NULL,
  source_doi = NULL,
  propositions = NULL
)

Arguments

theory

A theory object (named list).

id, label

Alternative fields.

key_constructs

Optional character vector of the rival's key constructs, which tf_landscape() matches against the literature.

source_doi

Optional DOI of the work that states the rival.

propositions

Optional list of the rival's own propositions over the theory's constructs, each a named list with id, from, to and relation, which tf_discriminate() sets against the theory's.

Value

The theory with the alternative added.

Examples

tf_theory("demo-1", "A demonstration theory") |>
  tf_add_alternative("alt1", "Cognitive appraisal account",
                     key_constructs = "appraisal",
                     propositions = list(list(id = "r1", from = "c_threat",
                                              to = "c_arousal", relation = "increases")))
#> $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_alternative"
#> 
#> $provenance[[2]]$detail
#> [1] "alt1"
#> 
#> 
#> 
#> $alternatives
#> $alternatives[[1]]
#> $alternatives[[1]]$id
#> [1] "alt1"
#> 
#> $alternatives[[1]]$label
#> [1] "Cognitive appraisal account"
#> 
#> $alternatives[[1]]$key_constructs
#> $alternatives[[1]]$key_constructs[[1]]
#> [1] "appraisal"
#> 
#> 
#> $alternatives[[1]]$propositions
#> $alternatives[[1]]$propositions[[1]]
#> $alternatives[[1]]$propositions[[1]]$id
#> [1] "r1"
#> 
#> $alternatives[[1]]$propositions[[1]]$from
#> [1] "c_threat"
#> 
#> $alternatives[[1]]$propositions[[1]]$to
#> [1] "c_arousal"
#> 
#> $alternatives[[1]]$propositions[[1]]$relation
#> [1] "increases"
#> 
#> 
#> 
#> 
#>