yml_find | R Documentation |
Edit a yaml configuration file via an API.
yml_find(path)
yml_add_files(config, filenames)
yml_disable_compile(config, filenames)
yml_enable_compile(config, filenames)
yml_add_objects(config, objects)
yml_list_objects(config)
yml_list_files(config)
yml_remove_objects(config, objects)
yml_remove_files(config, filenames)
yml_write(config, path = NULL)
path |
Path to the data package source or path to write config file (for |
config |
an R representation of the datapackager.yml config, returned by yml_find, or a path to the package root. |
filenames |
A vector of filenames. |
objects |
A vector of R object names. |
Add, remove files and objects, enable or disable parsing of specific files, list objects or files in a yaml config, or write a config back to a package.
A yaml configuration structured as an R nested list.
if(rmarkdown::pandoc_available()){
f <- tempdir()
f <- file.path(f,"foo.Rmd")
con <- file(f)
writeLines("```{r}\n vec = 1:10\n```\n",con=con)
close(con)
pname <- basename(tempfile())
datapackage_skeleton(name=pname,
path = tempdir(),
force = TRUE,
r_object_names = "vec",
code_files = f)
yml <- yml_find(file.path(tempdir(),pname))
yml <- yml_add_files(yml,"foo.Rmd")
yml_list_files(yml)
yml <- yml_disable_compile(yml,"foo.Rmd")
yml <- yml_enable_compile(yml,"foo.Rmd")
yml <- yml_add_objects(yml,"data1")
yml_list_objects(yml)
yml <- yml_remove_objects(yml,"data1")
yml <- yml_remove_files(yml,"foo.Rmd")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.