as.character.yamlet: Coerce Yamlet to Character

View source: R/yamlet.R

as.character.yamletR Documentation

Coerce Yamlet to Character

Description

Coerces yamlet to character. See also as_yamlet.character.

Usage

## S3 method for class 'yamlet'
as.character(x, sort = TRUE, ...)

Arguments

x

yamlet

sort

whether to coerce attribute order using canonical.yamlet

...

passed to as.character.yam and as_yam.yamlet

Value

character

See Also

Other yamlet: [.yamlet(), as_yamlet.character(), as_yamlet.data.frame(), as_yamlet.list(), as_yamlet.yamlet(), as_yamlet.yam(), as_yamlet(), print.yamlet()

Examples


as.character(as_yamlet('ID: subject identifier'))
as.character(as_yamlet(c('id: subject','amt: dose')))
as.character(as_yamlet(c('id: subject\namt: dose')))
foo <- as_yamlet(system.file(package = 'yamlet', 'extdata','quinidine.yaml'))
class(foo)
writeLines(as.character(foo))
identical(foo, as_yamlet(as.character(foo)))
identical(as.character(foo), as.character(as_yamlet(as.character(foo))))
file <- system.file(package = 'yamlet','extdata','quinidine.csv')
file
foo <- resolve(decorate(file))
as.character(as_yamlet(foo))
as.character(as_yamlet(foo, exclude_attr = 'class'))


yamlet documentation built on Oct. 6, 2023, 9:07 a.m.