Unable to Knit R to HTML

Unable to Knit R to HTML observed error in contrib.url(repos, "source") : trying use the CRAN without setting the mirror calls

Not sure, but try commenting out the install.packages('tidyverse')

i tried that still got the same issue

Not sure how much we'll be able to help without examining your system.

It seems strange it's trying to install from Cran even when install.packages(...) is commented out. Do you have any other install.packages(...) calls? Has the line quoted in the error message changed?

The other thing you could try is set up the default cran mirror if you haven't already. The layout in this video will be a bit out of date, but it'll give you an idea where to check.

Actually problem solved by adding rpos in package function

install.packages('tidyverse', repos = "http://cran.us.r-project.org")

Just to clarify, you only need to install packages once so it is not a good idea to include install.packages() commands in your Rmd file. All package installation should be done interactively.

1 Like

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: