Options$repos default problem

I recently had to reload R (3.51). Ever since, whenever I load or update an option, I get a warning:

Warning: unable to access index for repository NA/src/contrib:
scheme not supported in URL 'NA/src/contrib/PACKAGES'

The source of this error is obviou. I looked at options$repos, and the last entry is:

NA

I have been unable to remove this erroneous last entry permanently. Is there a way to reset the startup repos entry to remove this annoying, but apparently harmless, warning?

Thanks in advance for any help with this issue.

Larry Hunsicker

You can set repo with options(repos = c(CRAN = "https://cloud.r-project.org/") that you can put in your .Rprofile.

However, you should have a default repo configured. You can check that you don't have a repos set somewhere that erasing the default one with NA.

Do you have this error in an R session, an RStudio project or every time ?

Thanks, cderv. This turns out to have been a problem in my old .rprofile, which automatically listed a bunch of repos, including one that has since disappeared, leaving an NA in my options(repos). I removed the .rprofile line, since I now use a single repo, and that fixed the problem.

Glad to know you found the answer!
Even if it is your solution, 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: