| yml_replace {ymlthis} | R Documentation |
Replace, pluck, or discard top-level YAML fields
Description
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.
Usage
yml_replace(.yml, ...)
yml_discard(.yml, .rid)
yml_pluck(.yml, ...)
yml_chuck(.yml, ...)
Arguments
.yml |
a |
... |
additional named R objects, such as characters or lists, to transform into YAML |
.rid |
a character vector of fields to remove or a purrr-style lambda
with a predicate (~ predicate) where fields that are |
Value
a yml object
See Also
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()
Examples
yml() %>%
yml_clean(TRUE) %>%
yml_replace(clean = FALSE) %>%
yml_discard("author")
yml() %>%
yml_output(
pdf_document(),
html_document()
)%>%
yml_discard(~ length(.x) > 1)