Complete the code to create a parameterized report that accepts a year input.
params <- list(year = [1]) report <- render_report('sales_report.Rmd', params = params)
The year parameter should be passed as a string, so it needs quotes.
Complete the code to filter data by the parameter 'region' inside the report.
filtered_data <- subset(data, region == [1])params$region treats it as a string literal.Use params$region to access the parameter value inside the report.
Fix the error in the code to correctly pass multiple parameters to the report.
params <- list(year = [1], region = 'North')
Parameter values must be strings, so the year should be in quotes.
Fill both blanks to create a parameterized filter for sales data.
filtered_sales <- subset(sales, [1] == [2])
The first blank is the column name region, the second is the parameter value params$region.
Fill all three blanks to create a parameterized summary report filtering by year and product.
summary_data <- subset(data, [1] == [2] & [3] == params$product)
The first blank is the column year, the second is the parameter params$year, and the third is the column product.