### Programmatically create a partial justification object
justifierAssertion <-
justifier::assert(
"This is an assertion",
source = c(
justifier::source('This is a first source'),
justifier::source('This is a second source')));
### 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
);
### Show it
justifierJustification;
### Programmatically create a simple decision
simpleDecision <-
justifier::decide(
"decision",
justification = justifier::jstf(
"justification",
assertion = justifierAssertion
)
);
### Programmatically create a justification object for a full decision
fullJustifierObject <-
justifier::decide(
"I decide to go get an icecream",
justification = c(
justifier::justify(
"Having an icecream now would make me happy",
assertion = c(
justifier::assert(
"Decreasing hunger increases happiness",
source = justifier::source(
"My past experiences"
)
),
justifier::assert(
"I feel hungry",
source = justifier::source(
"Bodily sensations"
)
)
),
weight = 1
),
justifierJustification,
justifier::justify(
"I can afford to buy an icecream.",
assertion = c(
justifier::assert(
"My bank account balance is over 300 euro.",
source = justifier::source(
"My bank app"
)
),
justifier::assert(
"I need to keep at least 100 euro in my bank account.",
source = justifier::source(
"Parental advice"
)
)
),
weight = .3
)
)
);
### Show the full object
fullJustifierObject;
### Combine both into a list of decisions
twoDecisions <-
c(simpleDecision,
fullJustifierObject);
### Show the combination
twoDecisions;
Run the code above in your browser using DataLab