yml_replace()
replaces a named field with another value. As opposed to
duplicating top-level fields with other functions, explicitly replacing them
with yml_replace()
will not raise a warning. yml_discard()
removes values
given either a character vector of names or a purrr-style lambda with a
predicate (~ predicate); see the examples. yml_pluck()
and yml_chuck()
are wrappers around purrr::pluck()
and purrr::chuck()
that return yml
objects.
yml_replace(.yml, ...)
yml_discard(.yml, .rid)
yml_pluck(.yml, ...)
yml_chuck(.yml, ...)
a yml
object created by yml()
, as_yml()
, or returned by
a yml_*()
function
additional named R objects, such as characters or lists, to transform into YAML
a character vector of fields to remove or a purrr-style lambda
with a predicate (~ predicate) where fields that are TRUE
will be
discarded
a yml
object
Other yml:
asis_yaml_output()
,
bib2yml()
,
draw_yml_tree()
,
has_field()
,
read_json()
,
use_yml_defaults()
,
use_yml_file()
,
use_yml()
,
yml_author()
,
yml_blogdown_opts()
,
yml_bookdown_opts()
,
yml_citations()
,
yml_clean()
,
yml_distill_opts()
,
yml_latex_opts()
,
yml_output()
,
yml_pagedown_opts()
,
yml_params()
,
yml_pkgdown()
,
yml_reference()
,
yml_resource_files()
,
yml_rsconnect_email()
,
yml_rticles_opts()
,
yml_runtime()
,
yml_site_opts()
,
yml_toc()
,
yml_vignette()
# \donttest{
yml() %>%
yml_clean(TRUE) %>%
yml_replace(clean = FALSE) %>%
yml_discard("author")
#> ---
#> date: '`r format(Sys.Date())`'
#> clean: false
#> ---
#>
yml() %>%
yml_output(
pdf_document(),
html_document()
)%>%
yml_discard(~ length(.x) > 1)
#> ---
#> date: '`r format(Sys.Date())`'
#> ---
#>
# }