| flatten | R Documentation |
Flattening takes all justifications, assertions, and sources from their parents and returns a structured justifier object containing these elements in separate lists, with each occurrence replaced with a reference to the corresponding identifier.
flatten(x, ..., recursionLevel = 0, silent = justifier::opts$get("silent"))
## S3 method for class 'multipleJustifierElements'
flatten(x, ..., recursionLevel = 0, silent = justifier::opts$get("silent"))
## S3 method for class 'singleJustifierElement'
flatten(x, ..., recursionLevel = 0, silent = justifier::opts$get("silent"))
x |
The justifier object or objects. |
... |
Additional arguments are passed to the methods. |
recursionLevel |
The depth of the recursion |
silent |
Whether to be silent or chatty |
A flattened justifier object.
### Programmatically create a justification with two assertions
### but without sources
justifierJustification <-
justifier::justify(
"Icecream will make me feel less fit",
assertion = c(
justifier::assert('Icecream is rich in energy'),
justifier::assert('Consuming high-energy foods makes me feel less fit')
),
weight = -.5
);
### Flatten it into a structures justifier object
structuredJustification <-
justifier::flatten(
justifierJustification
);
### Check it
str(structuredJustification, 1);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.