-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathyaml.Rd
77 lines (65 loc) · 1.91 KB
/
yaml.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/yamlR.R
\name{yml_find}
\alias{yml_find}
\alias{yml_add_files}
\alias{yml_disable_compile}
\alias{yml_enable_compile}
\alias{yml_add_objects}
\alias{yml_list_objects}
\alias{yml_list_files}
\alias{yml_remove_objects}
\alias{yml_remove_files}
\alias{yml_write}
\title{Edit DataPackageR yaml configuration}
\usage{
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)
}
\arguments{
\item{path}{Path to the data package source or path to write config file (for \code{yml_write})}
\item{config}{an R representation of the datapackager.yml config, returned by yml_find, or a path to the package root.}
\item{filenames}{A vector of filenames.}
\item{objects}{A vector of R object names.}
}
\value{
A yaml configuration structured as an R nested list.
}
\description{
Edit a yaml configuration file via an API.
}
\details{
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.
}
\examples{
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")
}
}