colNumber: Format Collector Number

View source: R/colNumber.R

colNumberR Documentation

Format Collector Number

Description

The function standardizes the 'collector number' which is typically associated with biological records.

Usage

colNumber(x, colCodes = NULL, noNumb = "s.n.")

Arguments

x

a character string or vector

colCodes

a character string with the collection codes to be removed from the collector number. Default to NULL.

noNumb

character. The desired notation in the case of missing collector number. Defaults to "s.n."

Details

The function performs several edits such as removal of unnecessary spaces, letters, parentheses, and the replacement of missing information of collector numbers into a standardized notation, defined by the argument noNumb. Names of authors are automatically removed but not collection codes. Zeros and strings without numbers are treated as missing information.

Value

a character vector with the same length of x with the edited collector numbers.

Author(s)

Renato A. F. de Lima

References

Willemse, L.P., van Welzen, P.C. & Mols, J.B. (2008). Standardisation in data-entry across databases: Avoiding Babylonian confusion. Taxon 57(2): 343-345.

Examples

# A vector with some typical examples of formats found in herbarium labels
numbers <- c("3467", "3467 ", " 3467", "ALCB3467", "Gentry 3467",
"A. Gentry 3467", "Gentry, A. 3467", "ALCB-3467", "ALCB 3467", "3467a",
"3467A", "3467 A", "3467-A", "PL671", "57-685", "685 - 4724", "1-80",
"-4724", "(3467)", "(3467", "3467)", "32-3-77", "s/n.", "s.n.", "", NA)

# Using the function defaults
colNumber(numbers)

# Using the function to remove the collection code from the collector number
colNumber(numbers, colCodes = c("ALCB", "ESA"))

# Defining user-specific abbreviations for specimens without collector number
colNumber(numbers, colCodes = c("ALCB", "ESA"), noNumb = "n.a.")


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