library(magrittr)
# Initializing sample directory
tmp <- create_temp_dir("files")
create_sample_dir(tmp, override = TRUE)
full_path_chain(tmp, "kRoot", naming_k) %>%
list(kDirs = .) %>%
list(default = .) %>%
yaml::write_yaml(temp_path("config.yaml"))
# We can simply use such function
full_path_chain(tmp, "kRoot", naming_k) %>%
as_config("default", "kDirs") %>%
yaml::write_yaml(temp_path("config.yaml"))
Run the code above in your browser using DataLab