getCode | R Documentation |
Search for variants of collection and institution codes and return their standard codes based on the Index Herbariorum or the Index Xylariorum, if available.
getCode( x, inst.code = "institutionCode", col.code = "collectionCode", drop = c("ordem.colecao", "collectioncode.gbif", "institutioncode.gbif", "organization", "collection.string"), print.miss = FALSE )
x |
a data frame containing the collection codes. |
inst.code |
character. The column name containing the institution codes. |
col.code |
character. The column name containing the collection codes. |
drop |
character. List of columns names that should be dropped from the output. |
print.miss |
logical. |
The information on collection codes and names stored within plantR is currently biased towards plant-related collections. The main sources of information used to construct the database of collection codes were the Index Herbariorum (until 2019), the Brazilian Herbaria Network, the Index Xylariorum v4.1 and GBIF.
There is variation in the notation of institutions and collection codes in GBIF and other data repositories. Sometimes, the same collection is referred differently between these repositories. Thus, this function tried to provide a common code for each institution. To avoid mismatches the collection codes are compared to the list of collections using a string which combines both the institution and collection code.
If the collection code in not found in the Index Herbariorum, the same
collection code is returned without modifications. A mention if the code is
not found is stored in the 'collectionObs'. The argument print.miss
can be
set to TRUE if the user wants to print the table of collections not found.
the data frame x
with (at least) the additional columns called
'collectionCode.new' and 'collectionObs'.
Renato A. F. de Lima
df <- data.frame(institutionCode = c("ASU", "UNEMAT", "MOBOT", "NYBG"), collectionCode = c("ASU-PLANTS", "NX-FANEROGAMAS", "MO", "NY"), stringsAsFactors = FALSE) getCode(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.