Skip to contents

Create a reference to one or more justifier objects

Usage

idRef(x, what = NULL, silent = justifier::opts$get("silent"))

# S3 method for singleJustifierElement
idRef(x, what = NULL, silent = justifier::opts$get("silent"))

# S3 method for multipleJustifierElements
idRef(x, what = NULL, silent = justifier::opts$get("silent"))

# S3 method for justifierIdRef
idRef(x, what = NULL, silent = justifier::opts$get("silent"))

# S3 method for character
idRef(x, what = NULL, silent = justifier::opts$get("silent"))

# S3 method for justifierStructured
idRef(x, what = NULL, silent = justifier::opts$get("silent"))

Arguments

x

The identifier(s)

what

Optionally, what x is (decision, justification, assertion, or source).

silent

Whether to be silent or chatty.

Value

The justifier id reference object.

Examples

exampleSource <-
  justifier::source("This is a book about R.");

exampleAssertion <- justifier::assert(
  "R is a functional language",
  source = justifier::idRef(exampleSource)
);

### Get and show the reference
(sourceId <- exampleAssertion$source);
#> [1] "jrbq_S7n8bpcpf"
#> attr(,"class")
#> [1] "justifier"       "justifierIdRef"  "justifierSource" "character"      

sourceId <- as.character(sourceId);

### Manually assign an identifier
justifier::idRef(sourceId);
#> [1] "jrbq_S7n8bpcpf"
#> attr(,"class")
#> [1] "justifier"      "justifierIdRef" "character"     

### Repeat while specifying what we're passing
justifier::idRef(sourceId, what="source");
#> [1] "jrbq_S7n8bpcpf"
#> attr(,"class")
#> [1] "justifier"       "justifierIdRef"  "justifierSource" "character"