yaml_to_trick_list: Read YAML file into a list of trick objects and back

View source: R/10-yaml.R

yaml_to_trick_listR Documentation

Read YAML file into a list of trick objects and back

Description

You should rarely need to manipulate trick objects. A use case is creating a library of tricks from an existing

Usage

yaml_to_trick_list(file)

trick_list_to_yaml(tricks, file, append = TRUE)

Arguments

file

Path to a YAML file defining tricks

tricks

list of tricks to write to file

append

Whether to append to the file, if FALSE the file will be overwrtitten.

Value

Returns the first argument invisibly, called for side effects.

Examples

yaml_path <- system.file("tricks.yaml", package = "tricks")
tricks <- yaml_to_trick_list(yaml_path)
labels <- c("Edit user '.Rprofile'","Edit project '.Rprofile'")
trick_subset <- tricks[labels]
new_trick_library_path <- tempfile(fileext = ".yaml")
trick_list_to_yaml(trick_subset, new_trick_library_path)

moodymudskipper/poof documentation built on Dec. 10, 2024, 12:07 a.m.