Learn R Programming

yamlet (version 1.2.1)

as.character.yamlet: Coerce Yamlet to Character

Description

Coerces yamlet to character. See also as_yamlet.character.

Usage

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

Value

character

Arguments

x

yamlet

sort

whether to coerce attribute order using canonical.yamlet

...

passed to as.character.yam and as_yam.yamlet

See Also

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

Examples

Run this code

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'))

Run the code above in your browser using DataLab