Package 'expowo'

Title: An R package for mining global plant diversity and distribution data
Description: Produces diversity estimates and species lists with associated global distribution for any vascular plant family and genus from 'Plants of the World Online' database <https://powo.science.kew.org/>, by interacting with the source code of each plant taxon page. It also creates global maps of species richness, graphics of species discoveries and nomenclatural changes over time. For more details
Authors: Debora C. Zuanny [aut, cre, cph] , Domingos Cardoso [aut, ths, cph]
Maintainer: Debora Zuanny <[email protected]>
License: MIT + file LICENSE
Version: 2.0
Built: 2025-02-22 05:30:21 UTC
Source: https://github.com/dboslab/expowo

Help Index


Create graphics of species discoveries accumulation and nomenclatural changes

Description

Produces graphics of the dynamics of species description and historical nomenclature changes within any family or genus provided. It is designed to create graphics based on the dataframe resulted from powoSpecies. The graph type can be selected by two arguments (spp_acc and spp_changes) and then multiple graphs for any different taxonomic groups within the input data can be produced automatically in a single run.

Usage

accGraph(inputdf = NULL,
         verbose = TRUE,
         spp_acc = TRUE,
         spp_changes = TRUE,
         spp_changes_col = NULL,
         genus_plots = TRUE,
         save = FALSE,
         dir = "results_accGraph",
         filename = "cumulative_discovery_",
         format = "pdf")

Arguments

inputdf

A dataframe generated using powoSpecies function using the argument synonyms set as TRUE and containing the genus and species column and the associated information about the protologue of each species. The species name must be binomial, i.e. must contain both the genus name and specific epithet.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

spp_acc

Logical. Setting to FALSE means that you do not want to create individual accumulation graphs for each genus present in your dataset. The default is TRUE.

spp_changes

Logical. Setting to FALSE means that you do not want to create a violin plot with all data provided. The default is TRUE.

spp_changes_col

Define the name of a column in the main input data for which the species changes will be considered. For example, if densities and jitters should be presented for each genus in the same graphic, then set spp_changes_col = "genus". If you are plotting the dynamics of nomenclatural changes across the entire dataset in a single density graphic, then you must add a new column in your input data containing the same character inside all rows. In this case, ensure that you also keep genus_plots = TRUE.

genus_plots

Logical. If FALSE, a single density and jitter plot graphic will be produced for the entire input data. The default is TRUE, which will result in a graphic where multiple densities and jitters will be created inside the graphic, depending on the chosen column.

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_accGraph and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled cumulative_discovery_.

format

A character vector related to the file format of the graph to be saved. The default is "pdf" to save the output in Portable Document Format (.pdf), but you can also choose "jpg" to save in Joint Photographic Experts Group (.jpg), "tiff" to save in Tag Image File Format (.tiff) or "png" to save in Portable Network Graphics (.png).

Value

Objects of class c("gg", "ggplot") and saves the output on disk.

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

topGen

powoSpecies

powoFam

powoGenera

powoMap

Examples

## Not run: 

library(expowo)

accGraph(inputdf = "output",
         verbose = TRUE,
         spp_acc = TRUE,
         spp_changes = TRUE,
         spp_changes_col = "genus",
         genus_plots = TRUE,
         save = FALSE,
         dir = "results_accGraph",
         filename = "cumulative_discovery_Cyperaceae",
         format = "pdf")

## End(Not run)

List of Angiosperm species

Description

Complete list of all non-hybrid species and associated data of Lecythidaceae, Aristolochiaceae, Martyniaceae, Cabombaceae, and Begoniaceae, as retrieved from POWO database in November 2022 using the expowo's function powoSpecies.

Usage

data(angioData)

Format

data.frame


List of Angiosperm genera

Description

Complete list of all genera and associated data of Lecythidaceae, Aristolochiaceae, Begoniaceae, Martyniaceae, Dipterocarpaceae, and Fagaceae, as retrieved from POWO database in January 2023 using the expowo's function powoGenera.

Usage

data(angioGenera)

Format

data.frame


Countries and associated classification of botanical divisions

Description

Countries and associated classification of botanical divisions according to the World Geographical Scheme for Recording Plant Distributions.

Usage

data(botregions)

Format

data.frame

Source

https://www.tdwg.org/standards/wgsrpd/


Secondary function to transform data generated with powoSpecies

Description

Produces a spreadsheet with extra data about the publication, adding the corrected year of publication and the counting of synonyms of each species. It is an optional function to be used after run expowo's powoSpecies and to use as input data in the expowo's accGraph.

Usage

get_year_pubs(inputdf = NULL,
              verbose = TRUE,
              save = FALSE,
              dir = "results_POWO_with_year_pubs",
              filename = "POWO_with_year_pubs")

Arguments

inputdf

A dataframe generated using powoSpecies function with the argument synonyms set as TRUE and containing the genus and species column and the associated information about the protologue of each species. The species name must be binomial, i.e. must contain both the genus name and specific epithet.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

save

Logical, if TRUE, the transformed input POWO database will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_POWO_with_year_pubs and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled POWO_with_year_pubs.

Value

Objects of class dataframe and saves the output on disk.

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

powoSpecies

powoFam

powoGenera

accGraph

Examples

## Not run: 

library(expowo)

output <- powoSpecies(family = "Fabaceae",
                      genus = NULL,
                      synonyms = TRUE,
                      country = NULL,
                      save = FALSE,
                      dir = "Fabaceae_results_powoSpecies",
                      filename = "Fabaceae_spp")


output_year_pubs <- get_year_pubs(inputdf = output,
                                  verbose = TRUE,
                                  save = FALSE,
                                  dir = "results_POWO_with_year_pubs",
                                  filename = "POWO_with_year_pubs")

## End(Not run)

Extract megadiverse genera of any plant family

Description

Produces a CSV file listing all mega-diverse genera for any plant family at Plants of the World Online (POWO) based on a provided numeric value as the threshold to be considered mega-diverse. Frodin (2004) suggests 500 species as the threshold.

Usage

megaGen(family,
        thld = 500,
        verbose = TRUE,
        save = FALSE,
        dir = "results_megaGen",
        filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

thld

A defined threshold of species number for a genus to be considered megadiverse. The default value is 500 based on Frodin (2004).

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_megaGen and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus, authors, scientific_name, species_number (counting of species within each genus), kew_id (each genus code within Kew's databases), powo_uri (URI to access each genus in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

POWOcodes

Examples

## Not run: 

library(expowo)

megaGen(family = "Cyperaceae",
        thld = 500,
        save = FALSE,
        dir = "results_megaGen",
        filename = "Cyperaceae_big_genera")

## End(Not run)

Complete list of vascular plant families and associated URI addresses

Description

Complete list of the vascular plants (APG IV-based families of flowering plants, gymnosperms, ferns and lycophytes) and associated URI addresses as retrieved with the function get_pow of the package taxize.

Usage

data(POWOcodes)

Format

data.frame


Extract species number of any plant family

Description

Produces a CSV file listing the number of species and genera within the target botanical families of vascular plants available at Plants of the World Online (POWO).

Usage

powoFam(family,
        verbose = TRUE,
        save = FALSE,
        dir = "results_powoFam",
        filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_powoFam and the searched results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus_number (counting of genera within the specified plant family), species_number (countig of species within each genus), kew_id (the family code used in Kew's database), powo_uri (the URI to access the family in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

topGen

powoGenera

powoSpecies

powoMap

POWOcodes

Examples

## Not run: 
library(expowo)

powoFam(family = "Lecythidaceae",
        save = FALSE,
        dir = "results_powoFam",
        filename = "Lecythidaceae_spp_number")

## End(Not run)

Extract list of genera for any plant family

Description

Produces a CSV file listing all genera with associated number of accepted species and geographical distribution for any vascular plant family at Plants of the World Online (POWO).

Usage

powoGenera(family,
           genus = NULL,
           hybrid = FALSE,
           country = NULL,
           verbose = TRUE,
           rerun = FALSE,
           save = FALSE,
           dir = "results_powoGenera",
           filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

genus

Either one genus name or a vector of multiple genera that is present in POWO. If any genus name is not provided, then the function will search all accepted genera known for the target family.

hybrid

Logical, if TRUE, the search results will include hybrid genera.

country

Either one country name or a vector of multiple countries. If country names are provided, then the function will return only the genera that are native to such countries, according to POWO.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

rerun

Logical, if TRUE, a previously stopped search will continue from where it left off, starting with the last retrieved taxon. Please ensure that the 'filename' argument exactly matches the name of the CSV file saved from the previous search, and that the previously saved CSV file is located within a subfolder named after the current date. If it is not, please rename the date subfolder accordingly."

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_powoGenera and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus, authors, scientific_name, publication (information about the protologue of the genus), species_number, native_to_country (original distribution according to political country), native_to_botanical_countries (original distribution according to botanical country), introduced_to_country (exotic distribution according to political country), introduced_to_botanical_countries (exotic distribution according to botanical country), kew_id (genus code within Kew's databases), powo_uri (URI to access each genus in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

topGen

powoSpecies

powoFam

POWOcodes

Examples

## Not run: 
library(expowo)

powoGenera(family = "Lecythidaceae",
           verbose = TRUE,
           save = FALSE,
           dir = "results_powoGenera",
           filename = "Lecythidaceae_genera")

powoGenera(family = "Lecythidaceae",
           genus = "Bertholletia",
           country = c("Argentina", "Brazil", "French Guiana"),
           verbose = TRUE,
           save = FALSE,
           dir = "results_powoGenera",
           filename = "Lecythidaceae_search")

## End(Not run)

Create global maps of species richness

Description

Produces global-scale maps of species richness at political country and botanical country levels. Despite being originally designed to create maps for all input data of any specified taxonomic group (genus or family) from the search results with powoSpecies, the function is also useful for any dataframe-formatted input data that has at least a column with species and one or two columns with associated distribution in the countries and/or botanical regions. Multiple richness maps for any different taxonomic groups within the input data can be produced automatically in a single run by just specifying a column name with the associated taxonomic classification.

Usage

powoMap(inputdf = NULL,
        botctrs = FALSE,
        distcol = NULL,
        taxclas = NULL,
        verbose = TRUE,
        save = FALSE,
        vir_color = "viridis",
        bre_color = NULL,
        leg_title = "SR",
        dpi = 600,
        dir = "results_powoMap",
        filename = "global_richness_map",
        format = "jpg")

Arguments

inputdf

A dataframe with a species column and the associated global distribution at country or botanical country level. The species name must be as a binomial, i.e. must contain both the genus name and specific epithet, but the authorship is optional. Each species must be as a single row with its corresponding full distribution in all countries and/or botanical regions within a single cell of their respective columns, where the country names or botanical regions are separated by a comma. This is, for example, the standard dataframe from the search results with the function powoSpecies.

botctrs

Logical. If TRUE, the species richness maps will be created according to the botanical country subdivisions of the world. Also, a WGSRPD folder including the level 3 shapefile and the associated Brummitt's (2001) book fully describing the World Geographical Scheme for Recording Plant Distributions will be downloaded into the working directory. If you do not remove this folder or rename any of the contents, then the function will not download the same folder again. The default is FALSE.

distcol

Column name with the full global distribution data for each species at political country level or the level 3 of botanical subdivision of the World Geographical Scheme for Recording Plant Distributions. If the species distribution is given with botanical subdivisions, then you must also change the argument botctrs to TRUE. If the distribution is described only by political country names, then set botctrs to FALSE.

taxclas

A character vector with the column name for the corresponding taxonomic classification of each species in any higher taxonomic level. If provided, the function will produce, in a single run, all global richness maps for every distinct group within the input data. The default is NULL, then the function will generate only one global species richness map for the entire input data.

verbose

Logical. If FALSE, a message showing the map creation steps will not be printed in the console in full.

save

Logical, if TRUE, the global maps will be saved on disk.

vir_color

A character vector with the name or code of any of the color palettes from Viridis package.

bre_color

A character vector with the name or code of any of the color palettes from RColorBrewer package.

leg_title

A character vector to be displayed in the output map as a legend. Default is to create a title called SR, an acronym for species richness.

dpi

One number in the range of 72-4000 referring to the image resolution in the format of dots per inch in the output file. Default is to create an output with 600 dpi.

dir

Pathway to the computer's directory, where the map file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_powoMap and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled global_richness_map.

format

A character vector related to the file format of the global map to be saved. The default is "jpg" to save the output in Joint Photographic Experts Group (.jpg), but you can also choose "pdf" to save in Portable Document Format (.pdf), "tiff" to save in Tag Image File Format (.tiff) or "png" to save in Portable Network Graphics (.png).

Value

One or a list of objects of class c("gg", "ggplot").

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

topGen

powoSpecies

powoFam

powoGenera

Examples

## Not run: 
library(expowo)

mapspdist <- powoSpecies(family = "Martyniaceae",
                         hybridspp = FALSE,
                         country = NULL,
                         verbose = TRUE,
                         save = FALSE,
                         dir = "results_powoSpecies",
                         filename = "Martyniaceae_spp")

# To create multiple maps for each genus within the input data according to
# political countries.
powoMap(inputdf = mapspdist,
        botctrs = FALSE,
        distcol = "native_to_country",
        taxclas = "genus",
        verbose = FALSE,
        save = FALSE,
        vir_color = "viridis",
        bre_color = NULL,
        leg_title = "SR",
        dpi = 600,
        dir = "results_powoMap",
        filename = "global_richness_country_map",
        format = "jpg")

# To create multiple maps for each genus within the input data according to
# botanical country subdivisions.
powoMap(inputdf = mapspdist,
        botctrs = TRUE,
        distcol = "native_to_botanical_countries",
        taxclas = "genus",
        verbose = FALSE,
        save = FALSE,
        vir_color = "viridis",
        bre_color = NULL,
        leg_title = "SR",
        dpi = 600,
        dir = "results_powoMap",
        filename = "global_richness_botcountry_map",
        format = "jpg")

## End(Not run)

Extract distribution of any plant species

Description

Produces a CSV file listing the geographical distribution at country and botanical subdivisions of all target species of vascular plants at Plants of the World Online (POWO).

Usage

powoSpDist(family,
           species = NULL,
           verbose = TRUE,
           save = FALSE,
           dir = "results_powoSpDist",
           filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

species

Either one non-hybrid species name or a vector of multiple species that is present in POWO. If any species name is not provided, then the function will search any species from all accepted genera known for the target family.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_powoSpDist and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus, species, taxon_name, authors, scientific_name, native_to_country (original distribution according to political country), native_to_botanical_countries (original distribution according to botanical country), introduced_to_country (exotic distribution according to political country), introduced_to_botanical_countries (exotic distribution according to botanical country), kew_id (each species code within Kew's databases), powo_uri (URI to access each species in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

POWOcodes

Examples

## Not run: 
library(expowo)

powoSpDist(family = "Lecythidaceae",
           species = "Lecythis pisonis",
           save = FALSE,
           dir = "results_powoSpDist",
           filename = "L_pisonis_distribution")

## End(Not run)

Extract list of species for any plant genus and family

Description

Produces a CSV file listing all accepted species and associated geographical distribution from any target genus or family of vascular plants at Plants of the World Online (POWO).

Usage

powoSpecies(family,
            genus = NULL,
            hybrid = FALSE,
            synonyms = FALSE,
            country = NULL,
            verbose = TRUE,
            rerun = FALSE,
            save = FALSE,
            dir = "results_powoSpecies",
            filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

genus

Either one genus name or a vector of multiple genera that is present in POWO. If any genus name is not provided, then the function will search any species from all accepted genera known for the target family.

hybrid

Logical, if TRUE, the search results will include hybrid species.

synonyms

Logical, if TRUE, the search results will include synonyms.

country

Either one country name or a vector of multiple countries. If country names are provided, then the function will return only the species that are native to such countries, according to POWO.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

rerun

Logical, if TRUE, a previously stopped search will continue from where it left off, starting with the last retrieved taxon. Please ensure that the 'filename' argument exactly matches the name of the CSV file saved from the previous search, and that the previously saved CSV file is located within a subfolder named after the current date. If it is not, please rename the date subfolder accordingly."

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_powoSpecies and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus, species, taxon_name, authors, scientific_name, publication (information about the protologue of the species), native_to_country (original distribution according to political country), native_to_botanical_countries (original distribution according to botanical country), introduced_to_country (exotic distribution according to political country), introduced_to_botanical_countries (exotic distribution according to botanical country), kew_id (each species code within Kew's databases), powo_uri (the URI to access each species in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

megaGen

topGen

powoFam

powoGenera

POWOcodes

Examples

## Not run: 
library(expowo)

powoSpecies(family = "Martyniaceae",
            synonyms = TRUE,
            country = c("Argentina", "Brazil", "French Guiana"),
            save = FALSE,
            dir = "Martyniaceae_results_powoSpecies",
            filename = "Martyniaceae_spp")

## End(Not run)

Fastly save CSV file within a current date folder

Description

Uses fwrite to fastly write a CSV file within a current date subfolder of a provided specific directory.

Usage

saveCSV(df,
        dir = "results",
        filename = "output",
        verbose = TRUE,
        append = FALSE,
        save = TRUE,
        foldername = NULL)

Arguments

df

Any input list of same length vectors (e.g. data.frame and data.table).

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results and the input data.frame will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

verbose

Logical, if FALSE, a message showing the saving process will not be printed in the console in full.

append

Logical, if TRUE, the file is opened in append mode and column names (header row) are not written.

save

Logical, if FALSE, the input data.frame will be not be saved on disk.

foldername

A parameter only for internal use with expowo's main functions. You must keep this always as NULL.

Author(s)

Debora Zuanny & Domingos Cardoso

Examples

library(expowo)

res <- powoGenera(family = "Lecythidaceae",
                  verbose = TRUE,
                  save = FALSE)

saveCSV(res,
        dir = "results_powoGenera",
        filename = "Lecythidaceae_search",
        append = FALSE)

Extract the top most species-rich genera of any plant family

Description

Produces a CSV file listing the top most diverse genera of any target botanical family of vascular plants at Plants of the World Online (POWO).

Usage

topGen(family,
       limit = 10,
       verbose = TRUE,
       save = FALSE,
       dir = "results_topGen",
       filename = "output")

Arguments

family

Either one family name or a vector of multiple families that is present in POWO.

limit

A defined numerical value to limit the most diverse genera to be selected within each plant family. The default is to select the top ten richest genera.

verbose

Logical, if FALSE, a message showing each step during the POWO search will not be printed in the console in full.

save

Logical, if TRUE, the search results will be saved on disk.

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results_topGen and the search results will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

Value

A table with the following fields: family, genus, authors, scientific_name, species_number (counting of species within each genus), kew_id (each genus code within Kew's databases), powo_uri (URI to access each genus in POWO).

Author(s)

Debora Zuanny & Domingos Cardoso

See Also

POWOcodes

Examples

## Not run: 
library(expowo)

topGen(family = "Lecythidaceae",
       limit = 10,
       save = FALSE,
       dir = "results_topGen",
       filename = "Lecythidaceae_top_ten")

## End(Not run)