【发布时间】:2021-05-18 06:49:06
【问题描述】:
我正在尝试创建以下.YAML 文件:
summary:
title: "Table tabs"
link: ~
blocks: []
nested: nav-pills
nested_names: yes
(请注意,波浪号、方括号或yes 周围没有引号)。
我编写代码在 R 中创建它:
tabs <- list(
summary =
list(
title = "Table tabs",
link = "~",
blocks = "[]",
nested = "nav-pills",
nested_names = "yes"
)
)
write(yaml::as.yaml(tabs), file = "myfile.yaml"
但是当我将它写到 .YAML 时,它看起来像这样:
summary:
title: Table tabs
link: '~'
blocks: '[]'
nested: nav-pills
nested_names: 'yes'
即波浪号、方括号和是的周围有引号。
为什么会发生这种情况,我可以做些什么来防止它?
【问题讨论】: