As i try to knit in rmarkdown in desktop version it returns this message

processing file: YouTube-streamer-analysis.Rmd
|.. | 5% [unnamed-chunk-1]
Quitting from lines 12-20 [unnamed-chunk-1] (YouTube-streamer-analysis.Rmd)

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

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

my code chunks between line 12-20


Aside from the error message, you should definitely not install packages every time you knit an Rmarkdown document. If I were you I would install the packages first, and take out the the install.packages() lines.

From the error message it seems there is an issue with installing tidyverse. Do you have a mirror set up for CRAN? Because it says you do not. That is basically the source R will try to get the package(s) from. This is the list of mirrors: CRAN - Mirrors. It's good practice to pick one closest to you. In RStudio, go to Tools -> Global Options -> Packages -> pick a repository (mirror)

I have visited attached link :link: mentioned above and while installing of package i have been suggested by user to add another argument in install.packages("tidyverse", repos="") and now i am able to knit it . Suggest me wheather i am doing it right or else i have to do something else.

In the tools>global option>packages> primary repository by default selected to Global what else i need to change in order to work with my desktop version smoothly

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