df2taxlist | R Documentation |
Function converting template data frame into taxlist object. Also character vectors including taxonomic names will be converted but without any information on taxonomic ranks and parental taxa.
df2taxlist(x, ...)
## S3 method for class 'data.frame'
df2taxlist(x, taxonTraits, taxonViews, levels, clean_strings = TRUE, ...)
## S3 method for class 'character'
df2taxlist(x, ...)
x |
A data frame or a character vector with taxonomic names. If x is a data frame, the columns TaxonUsageID (integer with IDs for each name), TaxonConceptID (integer with IDs for the respective taxon concepts), and TaxonName (character) are mandatory. Other optional columns are AuthorName (character with names' authorities), AcceptedName (logical indicating whether the name is an accepted name or a synonym and will be set as TRUE by default), Level (factor sorting taxonomic ranks in the bottom-up direction), Parent (integer, the taxon concept ID of the parental taxon), and ViewID (integer pointing to the ID of taxonomic view, usually a bibliographic reference, and will be used only if 'taxonViews' is provided. Any further column not included in the prototype of taxlist will be considered as names' attributes and inserted in slot taxonNames. |
... |
Further arguments passed among methods. For the
|
taxonTraits |
A data frame with attributes of taxonomic concepts (optional). If provided, the column TaxonConceptID is mandatorial. |
taxonViews |
A data frame or biblio::lib_df with references of taxonomic views (optional). If provided, the column ViewID is mandatorial and have to match the homonymous column at 'x'. |
levels |
A character vector setting the levels or taxonomic ranks from the bottom to the top. This argument is optional and if missing, the column Level will be preserved (if factor) or coerced to factor, except in the case that no column Level is provided. |
clean_strings |
Logical value, whether function |
A taxlist object.
Miguel Alvarez kamapu78@gmail.com.
Cyperus <- read.csv(file = file.path(path.package("taxlist"), "cyperus",
"names.csv"))
head(Cyperus)
## Convert to 'taxlist' object
Cyperus$AcceptedName <- !Cyperus$SYNONYM
df2taxlist(Cyperus)
## Create a 'taxlist' object from character vectors
Plants <- df2taxlist(c("Triticum aestivum", "Zea mays"), AuthorName = "L.")
summary(Plants, "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.