Complete the code to load the knitr package for reproducible reports.
library([1])The knitr package is used to create reproducible reports in R.
Complete the code to create a reproducible report using R Markdown.
rmarkdown::render('[1].Rmd')
The file name for the R Markdown report is usually descriptive, here 'report.Rmd'.
Fix the error in the code to include code chunks in R Markdown.
```{r [1]
summary(cars)
```The chunk label 'setup' is used to name the code chunk in R Markdown.
Fill both blanks to create a reproducible report that includes a plot and hides code.
```{r [1], [2]=FALSE}
plot(cars)
```The chunk is named 'plot_chunk' and the code is hidden by setting echo=FALSE.
Fill all three blanks to create a reproducible report that filters data, summarizes it, and prints the result.
library(dplyr) result <- mtcars %>% filter([1] > 20) %>% summarize([2] = mean([3])) print(result)
The code filters cars with more than 20 horsepower, then calculates the average mpg and stores it as avg_mpg.