-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@CRAN@ message #10
Comments
Hi Jim, this is normal and you haven't done anything wrong. This is part of the input checking that Librarian does, colliding with a weird thing that R does to define a default CRAN URL. I have more details below, but this warning simply means that since you haven't manually defined a CRAN repo in the
Re. why this happens,
If you run
But if you run it in R.exe you'll get a placeholder value:
The R manual says that this is "a value that causes some utilities to prompt for a CRAN mirror", and indeed this is what happens in RStudio. But even if you're using RStudio to run R, there are some cases where RStudio just pipes your code into R.exe, like when you're stitching an RMarkdown document. In those cases, RStudio's defaults aren't used and so the repo URL that is passed on to The reason you get this warning message is that Librarian does some input validation to ensure that any value provided in To get R.exe to stop doing this, the manual says that you'd have to set the repository yourself in a site profile or user profile with
But I think this is a drag for users, so that's why I wonder if I should set a warning message specifically for this |
Thanks for the info, Desi. I'll personally fix the repo opiton in CRAN. To make Librarian even more attractive to the many newbies adopting R and the the package ecosystem, I think your suggestion to create a specific option is a good one.
Best,
Jim
James R. Hunter
jameshunterbr@gmail.com (mailto:jameshunterbr@gmail.com)
55-11-95327-5656 (tel:55-11-95327-5656)
Laboratório de Retrovirologia, EPM, UNIFESP (https://maps.google.com/?q=Laborat%C3%B3rio%20de%20Retrovirologia%2C%20EPM%2C%20UNIFESP)
…On Jan 23 2019, at 10:49 am, Desi Quintans ***@***.***> wrote:
Hi Jim, this is normal and you haven't done anything wrong. This is part of the input checking that Librarian does, colliding with a weird thing that R does to define a default CRAN URL. I have more details below, but this warning simply means that since you haven't manually defined a CRAN repo in the cran_repo argument, shelf() has set a sane default value for you. You have three courses of action:
The warning can be safely ignored.
You can manually set the cran_repo argument to a valid CRAN URL, like cran_repo = "https://cran.r-project.org".
You can set the argument quiet = TRUE.
Re. why this happens, shelf() tries to set a CRAN repo for you from the R options.
shelf <- function(... cran_repo = getOption("repos") ...)
If you run getOption("repos") in RStudio you'll get the URL that you've set in RStudio's options:
> getOption("repos")
#> CRAN
#> "https://cran.csiro.au/"
#> attr(,"RStudio")
#> [1] TRUE
But if you run it in R.exe you'll get a placeholder value:
> getOption("repos")
#> CRAN
#> ***@***.***@"
The R manual says that this is "a value that causes some utilities to prompt for a CRAN mirror", and indeed this is what happens in RStudio. But even if you're using RStudio to run R, there are some cases where RStudio just pipes your code into R.exe, like when you're stitching an RMarkdown document. In those cases, RStudio's defaults aren't used and so the repo URL that is passed on to shelf is shelf(..., cran_repo = ***@***.***@").
The reason you get this warning message is that Librarian does some input validation to ensure that any value provided in cran_repo is a valid URL. Since @cran@ is not a valid URL, it catches that, raises the warning, and defaults to https://cran.r-project.org/.
To get R.exe to stop doing this, the manual says (https://stat.ethz.ch/R-manual/R-devel/library/base/html/options.html) that you'd have to set the repository yourself in a site profile or user profile with
r <- getOption("repos")
r["CRAN"] <- "http://my.local.cran"
options(repos = r)
But I think this is a drag for users, so that's why shelf catches the problem, does it for you, and lets you know about it with a warning in case you want to use a different repository instead.
I wonder if I should set a warning message specifically for this @cran (https://github.com/cran)@ issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#10 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACTdTEgFztC4G-xYzSgF8qpgc8saK6lXks5vGFpBgaJpZM4aOo37).
|
I receive the following warning from R when using shelf:
I can't seem to find any other reference to @cran@, so I'mlisting it as an issue. Librarian defaults to where it should go anyway, so I'm not sure what's happening with the "cran_repo". Is it something in my R.profile file or does it come from your package?
Librarian shouldn't need to refer to CRAN as all the packages in the list above are on my drive. There is no actual problem in loaded them. That happens normally.
Hope this is useful.
Thanks,
Jim Hunter
The text was updated successfully, but these errors were encountered: