Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical / Boolean Parameters passed to quarto get changed to "yes" and "no" #124

Closed
marianklose opened this issue Oct 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@marianklose
Copy link

marianklose commented Oct 6, 2023

Hi there,

thanks for the amazing CLI and wrapper package for R. I just tried to pass some logical parameters (TRUE/FALSE) from a render.R script to quarto and they got coverted to "yes" and "no". The problem itself and a possible solutions is mentioned in this stackoverflow post:

https://stackoverflow.com/questions/73571919/how-to-pass-logical-parameters-with-the-quarto-r-package-to-the-knitr-chunk-opti

Since quarto-r is only a wrapper to the CLI I assume that it is not possible to pass booleans from R via YAML to quarto CLI. Would it be feasabile to put somewhere a hint in the documentation that booleans are being converted to a character string?

@cderv
Copy link
Collaborator

cderv commented Oct 9, 2023

Thanks for the report. This is indeed an issue because Quarto follow YAML 1.2 spec with no support for yes/no and yaml R package used by this package is following 1.1 spec with yes/no support for boolean.

cat(yaml::as.yaml(list(show_plot = TRUE, show_code = TRUE)))
#> show_plot: yes
#> show_code: yes

This is this issue

@cderv cderv added the bug Something isn't working label Oct 9, 2023
@cderv
Copy link
Collaborator

cderv commented Oct 9, 2023

closed by 5207b6c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants