to_yamlet.numeric | R Documentation |
Coerces numeric to yamlet storage format. By default, numeric values would be processed as character. But character values with a leading dash are ordinarily quoted, since in character context a leading dash could be mistaken for a yaml metacharacter. In the case of a numeric value, however, we can be fairly certain that, despite appearances, the dash if any is actually a negative sign. This method intends to leave negative numerics unquoted, like their positive counterparts.
## S3 method for class 'numeric'
to_yamlet(x, ...)
x |
object |
... |
ignored |
length-one character
Other to_yamlet:
to_yamlet.NULL()
,
to_yamlet.character()
,
to_yamlet.default()
,
to_yamlet.list()
,
to_yamlet.yamlet()
,
to_yamlet()
library(magrittr)
'a: [[d: [-1, 0, 1, 2]]]' %>% as_yamlet %>% to_yamlet
to_yamlet(c(a = 4, b = 5.8))
to_yamlet(list(a = 4, b = 5.8))
to_yamlet(numeric(0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.