
Export the attributes in a parsed source(s) object to YAML
Source:R/export_attributes_from_parsedSources.R
export_attributes_from_parsedSources.RdExport the attributes in a parsed source(s) object to YAML
Usage
export_attributes_from_parsedSources(
x,
file = "ROCK_attributes.rock",
path = NULL,
preventOverwriting = rock::opts$get("preventOverwriting")
)Examples
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(examplePath, "example-2.rock");
### Parse single example source
parsedExample <- rock::parse_source(exampleFile);
### Show attributes stord in YAML
### in the source
cat(
rock::export_attributes_from_parsedSources(
parsedExample,
file = NULL
)
);
#> ---
#> ROCK_attributes:
#> - caseId: 1
#> region: urban
#> age: 60s
#> - caseId: 2
#> region: rural
#> age: 20s
#> ---