Learn R Programming

spocc (version 0.1.0)

fixnames: Change names to be the same for each taxon.

Description

That is, this function attempts to take all the names that are synonyms, for whatever reason (e.g., some names have authorities on them), and collapses them to the same string - making data easier to deal with for making maps, etc.

Usage

fixnames(obj, how = "shortest", namevec = NULL)

Arguments

obj
An object of class occdat
how
One of a few different methods:
  • shortest Takes the shortest name string that is likely to be the prettiest to display name, and replaces alll names with that one, better for maps, etc.
  • query This method takes the names you orginally qu
namevec
A vector of names to replace names in the occurrence data.frames with. Only used if how="supplied"

Value

  • An object of class occdat.

Examples

Run this code
spp <- c('Danaus plexippus','Accipiter striatus','Pinus contorta')
dat <- occ(spp, from='gbif', gbifopts=list(georeferenced=TRUE))
fixnames(dat, how="shortest")$gbif
fixnames(dat, how="query")$gbif
fixnames(dat, how="supplied", namevec = c('abc', 'def', 'ghi'))$gbif

Run the code above in your browser using DataLab