C. Using '=' instead of ':' to assign parameter value
D. Missing 'params' section
Solution
Step 1: Review YAML parameter syntax
Parameters use colon ':' to assign values, not equals '='.
Step 2: Identify the syntax error
Here, month = "January" uses '=' which is invalid YAML syntax.
Final Answer:
Using '=' instead of ':' to assign parameter value -> Option C
Quick Check:
YAML params need ':' not '=' [OK]
Hint: YAML uses colon ':' for key-value pairs, never '=' [OK]
Common Mistakes:
Using '=' instead of ':' in YAML
Thinking quotes are mandatory for strings
Confusing output format with params syntax
5. You want to create a parameterized report that filters a dataset by category and year. Which approach correctly uses parameters in the R code chunk to filter df?
hard
A. filtered_df <- subset(df, category == params$category & year == params$year)