to_specList {justifier} | R Documentation |
Producing a list of specifications
Description
This function is for internal use, but has been exported in case it's useful for people working 'manually' with lists of justifications.
Usage
to_specList(x, types, type, idsRequired = TRUE, silent = TRUE)
Arguments
x |
The list to parse. |
types |
The class to assign to the specification
list (the |
type |
The class to assign to each specification
(in addition to |
idsRequired |
Whether to require identifiers. |
silent |
Whether to be chatty or silent. |
Value
A list of classes c("justifierSpecList", types)
where
each element is a specification of class
c("justifierSpec", type)
.
Examples
### Specify an example text
exampleFile <-
system.file("extdata",
"simple-example.jmd",
package="justifier");
### Show contents
cat(readLines(exampleFile), sep="\n");
### Load it with yum::load_and_simplify()
loadedMinutes <- yum::load_and_simplify(exampleFile);
### Show contents
names(loadedMinutes);
### Show classes
class(loadedMinutes["assertion"]);
### Convert to specification list
res <- to_specList(loadedMinutes["assertion"],
type="assertion",
types="assertions");
### Show classes
class(res);
### Show original and parsed objects
loadedMinutes["assertion"];
res;
[Package justifier version 0.2.6 Index]