Description Usage Arguments Value Examples
View source: R/simplify_by_flattening.R
This function does some cleaning and simplifying to allow efficient specification of elements in the YAML fragments.
1 | simplify_by_flattening(x, simplify = ".*", .level = 1)
|
x |
Extracted (and loaded) YAML fragments |
simplify |
A regular expression specifying which elements to simplify (default is everything) |
.level |
Internal argument to enable slightly-less-than-elegant 'recursion'. |
A simplified list (but still a list)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | yamlFragmentExample <- '
---
source:
-
id: src_1
label: "Label 1"
-
id: src_2
label: "Label 2"
assertion:
-
id: assertion_1
label: "Assertion 1"
-
id: assertion_2
label: "Assertion 2"
---
';
loadedExampleFragments <-
load_yaml_fragments(yamlFragmentExample);
simplified <-
simplify_by_flattening(loadedExampleFragments);
### Pre simmplification:
str(loadedExampleFragments);
### Post simmplification:
str(simplified);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.