You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This header passes validation at https://www.yamllint.com/, but when reading it with rmarkdown::yaml_front_matter() some parameter names are not handled correctly:
ymlthis::draw_yml_tree(
rmarkdown::yaml_front_matter(
textConnection("---\nparams:\n x: NA\n y: NA\n n: NA\n t: NA\n f: NA\n---")
)
)
└── params:
├── x: NA
├── 'TRUE': NA
├── 'FALSE': NA
├── t: NA
└── f: NA
The problem occurs for other parameter names such as Yes and yes but, interestingly, not with T or t. The root cause lies in yaml::yaml.load because the underlying parser supports YAML 1.1 rather than YAML 1.2. The fix is to quote the problematic parameter names:
ymlthis::draw_yml_tree(
rmarkdown::yaml_front_matter(
textConnection("---\nparams:\n x: NA\n 'y': NA\n 'n': NA\n t: NA\n f: NA\n---")
)
)
└── params:
├── x: NA
├── 'y': NA
├── 'n': NA
├── t: NA
└── f: NA
autoquarto attempts to handle the problem by converting any parameter names that appear as TRUE to y and any that appear as FALSE to n, but this obviously is not robust as more than one correct parameter name is mapped to each incorrect one.
Consider the YAML header
This header passes validation at https://www.yamllint.com/, but when reading it with
rmarkdown::yaml_front_matter()
some parameter names are not handled correctly:The problem occurs for other parameter names such as
Yes
andyes
but, interestingly, not withT
ort
. The root cause lies inyaml::yaml.load
because the underlying parser supports YAML 1.1 rather than YAML 1.2. The fix is to quote the problematic parameter names:autoquarto
attempts to handle the problem by converting any parameter names that appear asTRUE
toy
and any that appear asFALSE
ton
, but this obviously is not robust as more than one correct parameter name is mapped to each incorrect one.Also relevant:
n
is mapped toFALSE
in simple example vubiostat/r-yaml#122The text was updated successfully, but these errors were encountered: