[R-pkg-devel] URLs in DESCRIPTION file
Kevin R. Coombes
kev|n@r@coombe@ @end|ng |rom gm@||@com
Mon Apr 7 17:52:30 CEST 2025
Thanks. That's what I thought (though I was somewhat confused by the
different behaviors of winbuilder on the current and development
versions). I think the original DESCRIPTION file (from 2017?) just had
the URL. Some time after that, CRAN asked for the inclusion of the DOI,
but they didn't say to get rid of the URL. The code itself hasn't been
touched since at least 2019 (since it still works exactly the way it is
supposed to.)
And, becauseI have been both finding and losing things on the Internet
for several decades, I am not particularly confident that the DOI is
going to have a significantly longer stable lifetime than the NCBI URL.
So, for now at least, I think I will leave them both.
Best,
Kevin
On 4/7/2025 11:35 AM, Ivan Krylov wrote:
> В Mon, 7 Apr 2025 11:10:21 -0400
> "Kevin R. Coombes" <kevin.r.coombes using gmail.com> пишет:
>
>> But version R 4.5.0 RC comes back with;
>> (possibly) invalid URL. Status: 403 Message: Forbidden
>> I copied the URL as reported in the error message, pasted it into my
>> browser, and it worked just fine.
>>
>> Can I assume that this is just something weird about the
>> corresponding winbuilder server at the moment, and go ahead and
>> submit the package?
> This is a false positive. R CMD check sends automated requests to all
> URLs it finds in the package. PubMed "protects" itself from automated
> requests and returns an error code:
>
> $ curl -I https://pmc.ncbi.nlm.nih.gov/articles/PMC2730180/
> HTTP/2 403
> content-length: 134
> content-type: text/html; charset=UTF-8
> date: Mon, 07 Apr 2025 15:14:59 GMT
> alt-svc: clear
>
> Using a browser instead results in subtly different behaviour visible
> to the server, so the page loads successfully when clicking a link.
>
> I see you're already linking to the article's DOI, 10.4137/cin.s2846,
> and the article is not paywalled. Is it an option to remove the PubMed
> link? There is code that is intended to recommend to only use the DOI,
> but currently doesn't include a pattern for the new PubMed URLs:
>
> if(length(y) &&
> any(ind <-
> (grepl(re_or(c("^https://pubmed.ncbi.nlm.nih.gov/[0-9]+",
> "^https://www.ncbi.nlm.nih.gov/pmc/articles/PMC[0-9]+/$",
> "^https://academic.oup.com/.*(/[0-9]*){4}$",
> "^https://www.sciencedirect.com/science/article")),
> y$URL)))) {
> ## <FIXME>
> ## Ideally we would complain about such URLs in general
> ## and not only when the URL checks were not OK.
> paste(c("Please use DOIs for the following publisher URLs:",
> paste0(" ", y$URL[ind])),
> collapse = "\n")
> ## </FIXME>
> }
>
> If you don't want to remove the PubMed link, you can explain the
> "possibly invalid URL" as a false positive in the submission comment.
>
More information about the R-package-devel
mailing list