See the following example:
withr::with_dir(
tempdir(),
{
file <- "test.yaml"
writeLines(
"
default:
test:
- a: 1
b: 2
- a: 1
b: 2
dev:
test:
- a: 1
b: 3
- a: 2
b: 3
",
file
)
config::get("test", file = file, config = "dev")
}
)
#> [[1]]
#> [[1]]$a
#> [1] 1
#>
#> [[1]]$b
#> [1] 2
#>
#>
#> [[2]]
#> [[2]]$a
#> [1] 1
#>
#> [[2]]$b
#> [1] 2
Created on 2023-04-26 with reprex v2.0.2
See the following example:
Created on 2023-04-26 with reprex v2.0.2