Unable to output a Word document from RStudio

When trying to compile a Word document of my RScript, I get this error message

"Quitting from lines 3-62 [unnamed-chunk-1] (HW2.spin.Rmd)
Error in contrib.url():
! trying to use CRAN without setting a mirror
Backtrace:

  1. utils::install.packages("readxl")
  2. utils::contrib.url(repos, "source")
    Execution halted"

I set the CRAN mirror to a local region and I've updated RStudio. I'm a beginner so I'm not sure what else to do.

This is just a guess but I do not think you want to install packages in an Rmarkdown document.

Install any needed package before loading the Rmd file and just call it using

library(readxl)
1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.