Error in generating HTML report

Hard to tell without a proper REPRoducible EXample (reprex) illustrating your issue.

But it seems you are including install commands in your Rmd file. You shouldn't include this type of commands because each time you knit the document R is going to try to install those packages and probably fail. Packages are ment to be installed interactively from the console or a GUI (unless you consciously stablish an automated workflow).

Can you please show the content of your Rmd file? Or at least an analogous made up example that reproduces the issue?