[R-pkg-devel] DOI / URL issues in package vignettes

Joshua Wiley jw||ey@p@ych @end|ng |rom gm@||@com
Wed May 18 04:06:03 CEST 2022


Hi All,

I've been stuck on how best to include DOIs in R package vignettes.
I write the vignettes as R markdown files with knitr as the vignette
builder, which all goes fine.

I want to include references to relevant literature and use DOI links to
make accessing the articles easier. For example:

https://doi.org/10.1037/met0000434

This is written as plain text in the .Rmd and ends up as a URL in the HTML
file generated.
It works fine for me across Chrome, Edge, and Safari.

However,

curl -I -L https://doi.org/10.1037/met0000434

gives the below on my system, which (I think?) means you get the expected
redirect for a DOI and then a 403 forbidden error.  On the
win-builder.r-project.org service (which is fantastic) I get a status 400
bad request.

For other DOIs, I am regularly getting a 503 service unavailable status
from both curl on my machine and winbuilder, but working fine in browser
(e.g., for:   https://doi.org/10.1002/sim.7171).

Is there a general recommendation for how to proceed?  I could just leave
out the DOIs / URLs and give the rest of the journal article citation?

Many thanks for any suggestions,

Josh


curl results on my system:

HTTP/2 302
date: Wed, 18 May 2022 01:53:47 GMT
content-type: text/html;charset=utf-8
content-length: 189
location: http://doi.apa.org/getdoi.cfm?doi=10.1037/met0000434
vary: Accept
expires: Wed, 18 May 2022 02:30:38 GMT
permissions-policy: interest-cohort=(),browsing-topics=()
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="
https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com
\/report\/v3?s=AAEQKLp2NUIcaOqEhR0j05L49qqul40oBULIoJjX%2BE4DStgV6T7kO9IEw6Cvyi0YIpi00KhxEU6U4RVAmcL%2Bk99SSiUFi8C0zhbNVtMiP8fkAJ5hxjD45b0%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
strict-transport-security: max-age=31536000; includeSubDomains; preload
server: cloudflare
cf-ray: 70d0f611ed9117c8-MEL
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

HTTP/1.1 403 Forbidden
Content-Type: text/html
Cache-Control: no-cache, no-store
Connection: close
Content-Length: 831
X-Iinfo: 12-17360972-0 NNNN RT(1652838827325 8) q(0 -1 -1 -1) r(0 -1)
B15(14,0,0) U6
Set-Cookie:
visid_incap_2687304=x5XsfaekQlWXbrGsMojRaqtRhGIAAAAAQUIPAAAAAAAezC3HdC8AzCh9mM9hYUTR;
expires=Wed, 17 May 2023 13:30:24 GMT; HttpOnly; path=/; Domain=.apa.org
Set-Cookie:
incap_ses_321_2687304=9FtWe+A0czc6K/rZlGx0BKtRhGIAAAAAhdbt7joIFE3lh9nZHhJSjQ==;
path=/; Domain=.apa.org

win-builder result:

  URL: https://doi.org/10.1037/met0000434
    From: inst/doc/mixed-effects-marginaleffects.html
    Status: 400
    Message: Bad Request

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list