ShORCIDs: Converting ORCIDs to ShORCIDs and vice versa

orcid_to_shorcidR Documentation

Converting ORCIDs to ShORCIDs and vice versa

Description

These functions produce ShOCRIDs (Short ORCIDs) from ORCIDs and vice versa.

Usage

orcid_to_shorcid(x)

shorcid_to_orcid(x)

Arguments

x

The ORCID(s) or ShORCID(s).

Details

Conversion ORCID to ShORCID occurs by detaching the last character (the checksum) and storing it. Then in the first string of characters, all non-numbers are removed and the resulting number is converted to a base 30 system with numericToBase30(). The checksum is then re-attached. This is one separately because the checksum can be X (i.e. the only character in an ORCID that's not necessarily numeric). Conversion the other way around just inverts the process (and so uses base30toNumeric()).

Value

The ShORCID(s) or ORCID(s), as a character vector.

Examples

orcid_to_shortcid("0000-0002-9540-5371");

gitlab-r-packages-mirror/rock documentation built on Dec. 3, 2024, 5:40 p.m.