Title: | Tools for Interacting with the Brazilian Flora 2020 |
---|---|
Description: | Tools to quickly compile taxonomic and distribution data from the Brazilian Flora 2020. |
Authors: | Gustavo Carvalho |
Maintainer: | Gustavo Carvalho <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.3.8 |
Built: | 2024-11-07 02:40:51 UTC |
Source: | https://github.com/gustavobio/flora |
Convert the results of get.taxa() to the phylomatic sample format
df2phytaxa(taxa, uppercase = TRUE)
df2phytaxa(taxa, uppercase = TRUE)
taxa |
A data frame with columns named family, genus, and species. |
uppercase |
logical. Should the function capitalize first letters? |
Fix the name case of a taxon
fixCase(x)
fixCase(x)
x |
a unit character vector with a taxon |
fixCase("myrcia lingua") fixCase("Myrcia Lingua") fixCase("COFFEA ARABICA")
fixCase("myrcia lingua") fixCase("Myrcia Lingua") fixCase("COFFEA ARABICA")
Collect data from the Brazilian Flora checklist (http://floradobrasil.jbrj.gov.br).
This package contains a set of tools solving problems that arise when one has to collect taxonomic and distribution information for large datasets of plants. Interacting with the Brazilian Flora Checklist website from a web browser is often a slow and somewhat cumbersome process, especially if you are not sure about the correct spelling of a name. With flora, however, you can:
get a suggestion for the correct spelling of a name from an incorrect one
search for its current taxonomic status
get its author(s), synonym(s), family, distribution, and lower taxa
process lists of names and automatically solve synonyms and typing errors
flora now holds all the data it needs. All functions can be used whilst offline.
Get the phytogeographic domain of a list of taxa
get_domains(taxa)
get_domains(taxa)
taxa |
A data frame with taxon names as returned by get.taxa() |
A data frame as returned by get.taxa with an extra column named domain.
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_domains(taxa) ## End(Not run)
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_domains(taxa) ## End(Not run)
Get the listed endemism for a list of taxa
get_endemism(taxa)
get_endemism(taxa)
taxa |
A data frame with taxon names as returned by get.taxa() |
A data frame as returned by get.taxa with an extra column named vegtype.
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_endemism(taxa) ## End(Not run)
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_endemism(taxa) ## End(Not run)
Get the listed vegetation life forms for a list of taxa
get_lifeform(taxa)
get_lifeform(taxa)
taxa |
A data frame with taxon names as returned by get.taxa() |
A data frame as returned by get.taxa with an extra column named life.form
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_lifeform(taxa) ## End(Not run)
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_lifeform(taxa) ## End(Not run)
Get the listed vegetation types for a list of taxa
get_vegtype(taxa)
get_vegtype(taxa)
taxa |
A data frame with taxon names as returned by get.taxa() |
A data frame as returned by get.taxa with an extra column named vegtype.
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_vegtype(taxa) ## End(Not run)
## Not run: taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua")) get_vegtype(taxa) ## End(Not run)
This function returns all the synonyms of a given taxon according to the Brazilian Flora 2020.
get.synonyms(taxon, fix = FALSE, relationship = FALSE)
get.synonyms(taxon, fix = FALSE, relationship = FALSE)
taxon |
a character vector containing a name. |
fix |
should the function fix issues (synonyms, mispelled names) in taxon? |
relationship |
return the kind of relationship? |
a character vector
## Not run: get.synonyms("Myrcia lingua") ## End(Not run)
## Not run: get.synonyms("Myrcia lingua") ## End(Not run)
This function collects taxonomic information and distribution from the Brazilian Flora Checklist. Synonyms and misspelled names are resolved automatically. Results can be combined with life form, habitat, vernacular name, and occurrence data.
get.taxa( taxa, replace.synonyms = TRUE, suggest.names = TRUE, life.form = FALSE, habitat = FALSE, vegetation.type = FALSE, vernacular = FALSE, states = FALSE, establishment = FALSE, domain = FALSE, endemism = FALSE, drop = c("authorship", "genus", "specific.epiteth", "infra.epiteth", "name.status"), suggestion.distance = 0.9, parse = FALSE )
get.taxa( taxa, replace.synonyms = TRUE, suggest.names = TRUE, life.form = FALSE, habitat = FALSE, vegetation.type = FALSE, vernacular = FALSE, states = FALSE, establishment = FALSE, domain = FALSE, endemism = FALSE, drop = c("authorship", "genus", "specific.epiteth", "infra.epiteth", "name.status"), suggestion.distance = 0.9, parse = FALSE )
taxa |
a character vector containing one or more taxa, without authors
see |
replace.synonyms |
should the function automatically replace synonyms? |
suggest.names |
should the function try to correct misspelled names? |
life.form |
include the life form of the taxon? |
habitat |
include the habitat of the taxon? |
vegetation.type |
include the listed vegetation types? |
vernacular |
include vernacular names and localities? |
states |
include occurrence data? |
establishment |
include the establishment type (native, cultivated or naturalized)? |
domain |
return phytogeographyc domains? |
endemism |
is the taxon endemic to Brazil? |
drop |
NULL or character vector with names of columns with taxonomic information to be removed from the returned data frame. Available names: "id", "scientific.name", "accepted.name", "family", "genus", "specific.epiteth", "infra.epiteth", "taxon.rank", "authorship", "taxon.status", "name.status", "threat.status", and "search.str". |
suggestion.distance |
a value between 0 and 1 indicanting how conservative the name suggestion algorithm should be. Values closer to 1 are very conservative. Be very careful, lower values can give wrong suggestions. |
parse |
Parse names through the GBIF parser to remove authors? |
The returned data frame will contain a variable number of rows and
columns depending on how the function was called. For instance, since there
might be more than one vernacular name for each taxon, some rows
will be duplicated if vernacular
is set to TRUE
. All misspelled taxa
are automatically corrected if the function can come up with a reasonable
guess for the name. Conservation status follows the IUCN nomenclature.
a data frame
## Not run: data(plants) get.taxa(plants) get.taxa(plants, life.form = TRUE, establishment = TRUE) ## End(Not run)
## Not run: data(plants) get.taxa(plants) get.taxa(plants, life.form = TRUE, establishment = TRUE) ## End(Not run)
Get all downstream taxa from a family or genus name.
lower.taxa(taxon, accepted = TRUE)
lower.taxa(taxon, accepted = TRUE)
taxon |
a character vector with either a family or genus name |
accepted |
list only accepted names? |
## Not run: lower.taxa("Acosmium") lower.taxa("Zygophyllaceae") ## End(Not run)
## Not run: lower.taxa("Acosmium") lower.taxa("Zygophyllaceae") ## End(Not run)
Find the taxa that occur in a given state of Brazil.
occurrence(states, type = c("any", "only", "all"), taxa = NULL)
occurrence(states, type = c("any", "only", "all"), taxa = NULL)
states |
a character vector with one or more state abbreviations following. See notes for abbreviations. |
type |
type of matching to be used. |
taxa |
optional character vector to match against the states |
a data frame
List of abbreviations: http://en.wikipedia.org/wiki/States_of_Brazil
## Not run: occ.any <- occurrence(c("SP", "BA", "MG"), type = "any") occ.only <- occurrence(c("SP", "BA", "MG"), type = "only") occ.all <- occurrence(c("SP", "BA", "MG"), type = "all") occ.taxa <- occurrence(c("SP", "BA", "MG"), type = "all", taxa = lower.taxa("Myrcia")) head(occ.any) head(occ.only) head(occ.all) head(occ.taxa) ## End(Not run)
## Not run: occ.any <- occurrence(c("SP", "BA", "MG"), type = "any") occ.only <- occurrence(c("SP", "BA", "MG"), type = "only") occ.all <- occurrence(c("SP", "BA", "MG"), type = "all") occ.taxa <- occurrence(c("SP", "BA", "MG"), type = "all", taxa = lower.taxa("Myrcia")) head(occ.any) head(occ.only) head(occ.all) head(occ.taxa) ## End(Not run)
A small character vector containing 16 plant names. Contains accepted names, synonyms, and misspelled taxa.
A character vector with 16 names
This attempts to remove the authorities of a taxonomic name.
remove.authors(taxon)
remove.authors(taxon)
taxon |
a character vector containing a single taxon |
a character vector
## Not run: remove.authors("Coffea arabica L.") remove.authors("Chrysophyllum argenteum subsp. nitidum (G.F.W.Meyer) T.D.Penn.") ## End(Not run)
## Not run: remove.authors("Coffea arabica L.") remove.authors("Chrysophyllum argenteum subsp. nitidum (G.F.W.Meyer) T.D.Penn.") ## End(Not run)
This function standardizes taxa names. It is used mainly internally, but might be helpful to the end user in some situations.
standardize.names(taxon)
standardize.names(taxon)
taxon |
a character vector containing a single name |
a character vector
## Not run: standardize.names("Miconia sp 01") standardize.names("Miconia Sp 2") standardize.names("Sp18") ## End(Not run)
## Not run: standardize.names("Miconia sp 01") standardize.names("Miconia Sp 2") standardize.names("Sp18") ## End(Not run)
This function tries to suggest a valid name according to the Brazilian Flora Checklist using a possibly incorrect one as a starting point.
suggest.names( taxon, max.distance = 0.75, return.na = TRUE, ignore.words = NULL )
suggest.names( taxon, max.distance = 0.75, return.na = TRUE, ignore.words = NULL )
taxon |
a character vector containing a single name |
max.distance |
a numeric value indicating how conservative the function should be when searching for suggestions. Values close to 1 are very conservative |
return.na |
a logical indicating whether to return a |
ignore.words |
|
A character vector or NA
## Not run: suggest.names("Cofea arabyca") suggest.names("Myrcia bela") ## End(Not run)
## Not run: suggest.names("Cofea arabyca") suggest.names("Myrcia bela") ## End(Not run)
Remove duplicate and misplaced whitespace characters
trim(taxon)
trim(taxon)
taxon |
a character vector with a single taxon name |
a character vector
## Not run: trim(" Myrcia lingua") ## End(Not run)
## Not run: trim(" Myrcia lingua") ## End(Not run)
Search for taxa using vernacular names
vernacular(name, exact = FALSE)
vernacular(name, exact = FALSE)
name |
a vernacular name |
exact |
approximate or exact match? |
a data frame of results or NA
## Not run: vernacular("pimenta", exact = TRUE) vernacular("pimenta", exact = FALSE) ## End(Not run)
## Not run: vernacular("pimenta", exact = TRUE) vernacular("pimenta", exact = FALSE) ## End(Not run)
This function starts a local webserver to run the shiny app distributed with the package.
web.flora()
web.flora()