How can I read the following string where 'Yes' are not converted to true
string <- "
a:
cc : dd
dd : ee
b:
ee : Yes
ff : 1
"
Now I get
yaml.load(string)
#$a
#$a$cc
#[1] "dd"
#$a$dd
#[1] "ee"
#
#$b
#$b$ee
#[1] TRUE
#$b$ff
#[1] 1
You could use the identity function as a hanlder:
yaml.load(string, handlers = list("bool#yes" = identity))
which gives you:
$a
NULL
$cc
[1] "dd"
$dd
[1] "ee"
$b
NULL
$ee
[1] "Yes"
$ff
[1] 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With