getTombo: Create Record Identifiers

View source: R/getTombo.R

getTomboR Documentation

Create Record Identifiers

Description

This function creates a unique identifier for species records by concatenating the collection code and accession number of each record

Usage

getTombo(collection = NULL, accession = NULL, by.coll = TRUE, to.lower = FALSE)

Arguments

collection

a vector with the collection codes.

accession

a vector with the accession numbers.

by.coll

logical. Should the removal of collection codes at the beginning of the accession numbers be removed based on the corresponding collection code provided in collection? Defaults to TRUE.

to.lower

logical. Should the final unique identifier be converted to lower cases? Default to FALSE.

Details

The function performs small edits in the accession number (the Darwin Core field 'catalogNumber'), such as the removal of spaces, hyphens, points and non-ascii characters. The function also remove all zeros at the beginning of the number, to simplify the notation.

Accession numbers may contain the collection code at their beginning. The function can remove this codes in two ways. The default way (by.coll = TRUE) removes only the codes matching the corresponding code provided in collection. The second way removes all letters in the beginning of the number irrespectively of the collection code (by.coll = FALSE).

It only edits the accession number, assuming that the collection code (the Darwin Core field 'collectionCode') has already been standardized using another plantR function, getCode(). The final identifier can be returned as is (the default) or in lower cases by setting the argument to.lower to TRUE.

Value

the collection codes and the edited accession numbers concatenated using an underline mark (i.e '_').

Author(s)

Renato A. F. de Lima

See Also

getCode

Examples

colls <- c("P", "P", "NY", "G", "P", "P", "NY", "G",
"P", "P", "NY", "G", NA, NA)
access <- c("1427", "P001427", "NY1427", "G-G-1427/1",
"1427A", "1427 a", "1427-A", "U.1427", "P1427a", ""," ", NA, "1427", NA)

getTombo(colls, access)


LimaRAF/plantR documentation built on Jan. 1, 2023, 10:18 a.m.