trouble with Knit in RMD file

Hello guys new to R here:
I was wondering if someone could help me with a little problem that I been having.
I am trying to complete a case study. However, whenever I try to document my analysis into a RMD file I comes across this error.

processing file: Case study

Error in contrib.url():
! trying to use CRAN without setting a mirror
Backtrace:

  1. utils::install.packages("here")
  2. utils::contrib.url(repos, "source")

Quitting from lines 51-56 [installing packges] (case_study.Rmd)
Execution halted

It only appears whenever I add code chunks into the RMD file.
I will really appreciate it if someone could give this newbie a little help

You should not use install.packages() in the RMD file. Install the packages separately and then use the library() function to load them in the RMD file.

1 Like

This topic was automatically closed 7 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.