ms_doi: Validate and normalise persistent identifiers

View source: R/identifiers.R

ms_doiR Documentation

Validate and normalise persistent identifiers

Description

Each function accepts identifiers as typed by people or returned by APIs (bare, with a prefix such as ⁠doi:⁠, or as a resolver URL) and returns the canonical bare form, or NA when the input is not a valid identifier. They are vectorised and never call the network: a valid identifier is well-formed, which does not prove that it is registered.

Usage

ms_doi(x, url = FALSE)

ms_orcid(x, url = FALSE)

ms_ror(x, url = FALSE)

Arguments

x

A character vector.

url

If TRUE, return the resolver URL instead of the bare form.

Details

  • ms_doi(): lower-cased ⁠10.xxxx/suffix⁠. DOIs are case-insensitive.

  • ms_orcid(): ⁠0000-0000-0000-000X⁠, with the ISO 7064 MOD 11-2 check digit verified.

  • ms_ror(): the nine-character ROR ID, with its ISO 7064 MOD 97-10 check digits verified.

Value

A character vector the length of x.

Examples

ms_doi(c("https://doi.org/10.5281/ZENODO.23881633", "doi:10.1000/xyz", "nope"))
ms_orcid(c("https://orcid.org/0000-0002-1825-0097", "0000-0002-1825-0098"))
ms_ror("https://ror.org/03ths8210")
ms_ror("03ths8210", url = TRUE)

metascience documentation built on Nov. 23, 2026, 5:07 p.m.