stw_to_yaml: Output to YAML format

Description Usage Arguments Value Examples

View source: R/stw_to_yaml.R

Description

Use these functions to convert your metadata to YAML format. The function stw_to_yaml() returns a YAML string, stw_use_yaml() copies a YAML string to your clipboard, and str_write_yaml() writes a YAML string to a file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
stw_to_yaml(meta, ...)

## Default S3 method:
stw_to_yaml(meta, ...)

## S3 method for class 'stw_meta'
stw_to_yaml(meta, ...)

stw_use_yaml(meta)

stw_write_yaml(meta, file)

Arguments

meta

Object with S3 class stw_meta, contains meta-data

...

additional arguments (not used)

file

character path of file to write

Value

stw_to_yaml()

character, YAML string

stw_use_yaml()

invisible(meta), called for side-effects

stw_write_yaml()

invisible(meta), called for side-effects

Examples

1
2
3
4
5
6
7
cat(stw_to_yaml(diamonds_meta))
stw_write_yaml(diamonds_meta, tempfile(fileext = ".yml"))
## Not run: 
# not run because it copies text to the clipboard
stw_use_yaml(diamonds_meta)

## End(Not run)

ijlyttle/steward documentation built on Jan. 5, 2021, 2:25 p.m.