You can subset Config by identifier or by position using the `[`, `[[` or `$` operator. The string will be expanded if it's a path.

# S4 method for Config
[(x, i)

# S4 method for Config
[[(x, i)

# S4 method for Config
$(x, name)

Arguments

x

a "Config" object.

i

position of the identifier or the name of the identifier itself.

name

name of the element to access.

Value

An element held in "Config" object

Examples

projectConfig = system.file("extdata", "example_peps-master",
"example_amendments1", "project_config.yaml", package="pepr")
c=Config(projectConfig)
#> Loading config file: /home/runner/work/_temp/Library/pepr/extdata/example_peps-master/example_amendments1/project_config.yaml
#>   amendments: newLib,newLib2
c[[2]]
#> [1] "/home/runner/work/_temp/Library/pepr/extdata/example_peps-master/example_amendments1/sample_table.csv"
c[2]
#> [[1]]
#> [1] "/home/runner/work/_temp/Library/pepr/extdata/example_peps-master/example_amendments1/sample_table.csv"
#> 
c[["sample_table"]]
#> [1] "/home/runner/work/_temp/Library/pepr/extdata/example_peps-master/example_amendments1/sample_table.csv"
c$sample_table
#> [1] "/home/runner/work/_temp/Library/pepr/extdata/example_peps-master/example_amendments1/sample_table.csv"