|
| 1 | +# check_params_for_na detects NA in simple vectors |
| 2 | + |
| 3 | + Code |
| 4 | + check_params_for_na(bad_params) |
| 5 | + Condition |
| 6 | + Error in `check_na_recursive()`: |
| 7 | + ! `NA` values detected in parameter values |
| 8 | + x Found NA at position: 2 |
| 9 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 10 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 11 | + Consider these alternatives: |
| 12 | + * Remove NA values from your data before passing to Quarto |
| 13 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 14 | + * Handle missing values within your document code using conditional logic |
| 15 | + |
| 16 | +# check_params_for_na detects NA in nested structures |
| 17 | + |
| 18 | + Code |
| 19 | + check_params_for_na(nested_params) |
| 20 | + Condition |
| 21 | + Error in `check_na_recursive()`: |
| 22 | + ! `NA` values detected in parameter data$subset |
| 23 | + x Found NA at position: 2 |
| 24 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 25 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 26 | + Consider these alternatives: |
| 27 | + * Remove NA values from your data before passing to Quarto |
| 28 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 29 | + * Handle missing values within your document code using conditional logic |
| 30 | + |
| 31 | +# check_params_for_na shows correct NA positions |
| 32 | + |
| 33 | + Code |
| 34 | + check_params_for_na(multi_na_params) |
| 35 | + Condition |
| 36 | + Error in `check_na_recursive()`: |
| 37 | + ! `NA` values detected in parameter x |
| 38 | + x Found NA at positions: 2 and 4 |
| 39 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 40 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 41 | + Consider these alternatives: |
| 42 | + * Remove NA values from your data before passing to Quarto |
| 43 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 44 | + * Handle missing values within your document code using conditional logic |
| 45 | + |
| 46 | +# as_yaml detects NA in simple vectors |
| 47 | + |
| 48 | + Code |
| 49 | + as_yaml(list(values = c(1, NA, 3))) |
| 50 | + Condition |
| 51 | + Error in `check_na_recursive()`: |
| 52 | + ! `NA` values detected in parameter values |
| 53 | + x Found NA at position: 2 |
| 54 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 55 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 56 | + Consider these alternatives: |
| 57 | + * Remove NA values from your data before passing to Quarto |
| 58 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 59 | + * Handle missing values within your document code using conditional logic |
| 60 | + |
| 61 | +# write_yaml detects NA in nested structures |
| 62 | + |
| 63 | + Code |
| 64 | + write_yaml(list(data = list(subset = c(1, NA, 3))), tempfile()) |
| 65 | + Condition |
| 66 | + Error in `check_na_recursive()`: |
| 67 | + ! `NA` values detected in parameter data$subset |
| 68 | + x Found NA at position: 2 |
| 69 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 70 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 71 | + Consider these alternatives: |
| 72 | + * Remove NA values from your data before passing to Quarto |
| 73 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 74 | + * Handle missing values within your document code using conditional logic |
| 75 | + |
| 76 | +# as_yaml shows correct NA positions |
| 77 | + |
| 78 | + Code |
| 79 | + as_yaml(list(x = c(1, NA, 3, NA))) |
| 80 | + Condition |
| 81 | + Error in `check_na_recursive()`: |
| 82 | + ! `NA` values detected in parameter x |
| 83 | + x Found NA at positions: 2 and 4 |
| 84 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 85 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 86 | + Consider these alternatives: |
| 87 | + * Remove NA values from your data before passing to Quarto |
| 88 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 89 | + * Handle missing values within your document code using conditional logic |
| 90 | + |
| 91 | +# quarto_render uses write_yaml validation |
| 92 | + |
| 93 | + Code |
| 94 | + quarto_render("test.qmd", execute_params = list(bad_param = c(1, NA))) |
| 95 | + Condition |
| 96 | + Error in `check_na_recursive()`: |
| 97 | + ! `NA` values detected in parameter bad_param |
| 98 | + x Found NA at position: 2 |
| 99 | + i Quarto CLI uses YAML 1.2 spec which cannot process R's `NA` values |
| 100 | + i R's `NA` gets converted to YAML strings (like `.na.real`) that Quarto doesn't recognize as missing values |
| 101 | + Consider these alternatives: |
| 102 | + * Remove NA values from your data before passing to Quarto |
| 103 | + * Use `NULL` instead of `NA` for missing optional parameters |
| 104 | + * Handle missing values within your document code using conditional logic |
| 105 | + |
0 commit comments