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
Please allow us to disable param defaults #762
Comments
Here is the error that is obtained when a multi-select value is chosen and then unset before choosing to knit with custom values:
This indicates that |
R Markdown does not require parameters to have defaults. The following documents will report
You could also specify: @yihui / @jjallaire - How do you feel about assuming a parameter without a |
I am investigating the error caused by |
UI values may revert to NULL if their value is cleared. Take a multi-input, for example. When choices are removed, its value becomes NULL. This was missing before, as we blindly ignored NULL UI values. part of #762
I think #768 will improve handling of NULL values, but there is still work remaining. |
@DianaCesar Unfortunately, support for We hope to improve |
OK. Thanks for the update. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
This is more of a request than an issue.
Currently, when a parameterized .Rmd is created, a default value must be coded for each param. For example, if I have the following param in the YAML...
...then I must specify a default option to go into the 'value' spot. If I leave this spot blank, it throws an error*. If I try knitting this doc with the above code, then backspacing this param widget so that no value is showing, it returns the first available value (from my choices) in the rendered doc.
It seems that RMarkdown requires a default value for every param in order to render. Is there a way I could create a parameter with no defaults (i.e., a param that passes through to the output as NULL)?
*There seems to be some NULL capability built into params in RMarkdown, but it is unpredictable (or I am using it incorrectly). For example, when I leave the 'value:' spot blank (or I make it NULL) and knit the doc with parameters, I can sometimes get an option to appear in the select widget that says "Unspecified (NULL)" and another option that says "Use a custom value." Selecting the first option does pass a NULL value through to the output. Selecting the second option resets the widget to display my original choices, but throws an error during the knit. It seems like the more coder-friendly alternative would be to simply allow RMarkdown to interpret these NULL values (or blank widgets) as such, without displaying the extra options.
Thank you,
Diana
The text was updated successfully, but these errors were encountered: