Trying to use CRAN without setting a mirror

Solution: When we install packages in R, we need to do it in the console and not in the RMarkdown document because it causes this error when knitting. To fix this problem:

  • Remove the install.packages() code from the RMarkdown document

  • Install the package in the console

  • Try re-knitting the RMarkdown document