# Mining genus list for any vascular plant family

Here in this article, we show how to use the package’s function `powoGenera` for mining all accepted genera for any family of vascular plants available at POWO.

## Setup

Install the latest development version of expowo from GitHub:

    #install.packages("devtools")
    devtools::install_github("DBOSlab/expowo")

    library(expowo)

## Mining all accepted genera for some plant families

The function `powoGenera` returns a data frame or saves a CSV file listing all genera with associated number of accepted species and their global geographic distribution at country or botanical level. The global classification of botanical divisions follows the World Geographical Scheme for Recording Plant Distributions, which is already associated with each taxon’s distribution in POWO. Here, we extracted the data for Aristolochiaceae, Begoniaceae, Martyniaceae.

    ABM <- powoGenera(family = c("Aristolochiaceae", "Begoniaceae", "Martyniaceae"),
                      hybrid = FALSE,
                      verbose = FALSE,
                      save = FALSE,
                      dir = "results_powoGenera",
                      filename = "Arist_Begon_Martyniaceae_search")

TABLE 1. A general `powoGenera` search for mining all accepted genera for some specific families.
family | genus | authors | scientific_name | publication | species_number | kew_id | powo_uri
--- | --- | --- | --- | --- | --- | --- | ---
Aristolochiaceae | Aristolochia | L. | Aristolochia L. | Sp. Pl.: 960 (1753) | 554 | 330834-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:330834-2
Aristolochiaceae | Asarum | L. | Asarum L. | Sp. Pl.: 442 (1753) | 137 | 3127-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:3127-1
Aristolochiaceae | Euglypha | Chodat & Hassl. | Euglypha Chodat & Hassl. | Bull. Herb. Boissier, sér. 2, 6: 138 (1906) | 1 | 295147-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:295147-2
Aristolochiaceae | Hydnora | Thunb. | Hydnora Thunb. | Kongl. Vetensk. Acad. Handl. 36: 69 (1775) | 10 | 30159275-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:30159275-2
Aristolochiaceae | Lactoris | Phil. | Lactoris Phil. | Verh. K. K. Zool.-Bot. Ges. Wien 15: 521 (1865) | 1 | 32025-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:32025-1
Aristolochiaceae | Prosopanche | de Bary | Prosopanche de Bary | Abh. Naturf. Ges. Halle 10: 267 (1868) | 7 | 14132-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:14132-1
Aristolochiaceae | Saruma | Oliv. | Saruma Oliv. | Hooker's Icon. Pl. 19: t. 1895 (1889) | 1 | 3165-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:3165-1
Aristolochiaceae | Thottea | Rottb. | Thottea Rottb. | Nye Saml. Kongel. Danske Vidensk. Selsk. Skr. 2: 529 (1783) | 46 | 3169-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:3169-1
Begoniaceae | Begonia | L. | Begonia L. | Sp. Pl.: 1056 (1753) | 2120 | 327437-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:327437-2
Begoniaceae | Hillebrandia | Oliv. | Hillebrandia Oliv. | Trans. Linn. Soc. London 25: 361 (1866) | 1 | 3888-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:3888-1
Martyniaceae | Craniolaria | L. | Craniolaria L. | Sp. Pl.: 618 (1753) | 2 | 31831-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:31831-1
Martyniaceae | Holoregmia | Nees | Holoregmia Nees | M.A.P.zu Wied-Neuwied, Reise Bras. 2: 344 (1821) | 1 | 327223-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:327223-2
Martyniaceae | Ibicella | (Stapf) Van Eselt. | Ibicella (Stapf) Van Eselt. | Techn. Bull. New York Agric. Exp. Sta., Geneva 149: 31 (1929) | 2 | 26127-1 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:26127-1
Martyniaceae | Martynia | L. | Martynia L. | Sp. Pl.: 618 (1753) | 2 | 30002379-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:30002379-2
Martyniaceae | Proboscidea | Schmidel | Proboscidea Schmidel | Icon. Pl. Anal., ed. Keller: 49 (1763) | 7 | 30064181-2 | http://www.plantsoftheworldonline.org/taxon/urn:lsid:ipni.org:names:30064181-2

## Mining all accepted genera for all vascular plant families

To mine a global genus checklist with associated species number and distribution for all families of vascular plants, we recommend to load the dataframe-formatted data object called `POWOcodes` that comes associated with the expowo package. Because the `POWOcodes` data object already contains the URI addresses for all angiosperms, gimnosperms and pteridophytes families recognized in the POWO database, you just need to run the code below.

The example below shows how to mine a global checklist of all accepted genera of plants by using the vector of all families and associated URI addresses stored in the `POWOcodes` object.

    data(POWOcodes)

    ALL_gen <- powoGenera(POWOcodes$family,
                          hybrid = TRUE,
                          verbose = TRUE,
                          save = FALSE,
                          dir = "results_powoGenera",
                          filename = "all_plant_genera")

Since this is a very long search that might requires days to be completed, it may happen to loose internet connection at some point of the queried search. But you do not need to start an entirely new search from the beginning. By setting the `powoGenera` with `rerun = 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.

    data(POWOcodes)

    ALL_gen <- powoGenera(POWOcodes$family,
                          hybrid = TRUE,
                          verbose = TRUE,
                          rerun = TRUE,
                          save = FALSE,
                          dir = "results_powoGenera",
                          filename = "all_plant_genera")

## Narrowing down the `powoGenera` search based on a specified country vector

You can also narrow down the search for all accepted genera of any family so as to focus on just a particular country or a list of countries. You just need to define a vector of country names in the argument `country`. In the example below, see that we have originally searched for the genera within the families Aristolochiaceae, Lecythidaceae, Fagaceae, and Dipterocarpaceae, but the function only returned a list of genera of Aristolochiaceae and Lecythidaceae, because the remaining families do not have any genera recorded in the list of countries of interest, i.e. Argentina, Brazil or French Guiana.

    ADFL <- powoGenera(family = c("Aristolochiaceae", "Dipterocarpaceae",
                                  "Fagaceae", "Lecythidaceae"),
                       hybrid = FALSE,
                       country = c("Argentina", "Brazil", "French Guiana"),
                       verbose = FALSE,
                       save = FALSE,
                       dir = "results_powoGenera",
                       filename = "country_constrained_search")

TABLE 2. A `powoGenera` search based on a specified country vector.
family | genus | authors | scientific_name | publication | species_number
--- | --- | --- | --- | --- | ---
Aristolochiaceae | Aristolochia | L. | Aristolochia L. | Sp. Pl.: 960 (1753) | 554
Aristolochiaceae | Euglypha | Chodat & Hassl. | Euglypha Chodat & Hassl. | Bull. Herb. Boissier, sér. 2, 6: 138 (1906) | 1
Aristolochiaceae | Prosopanche | de Bary | Prosopanche de Bary | Abh. Naturf. Ges. Halle 10: 267 (1868) | 7
Lecythidaceae | Allantoma | Miers | Allantoma Miers | Trans. Linn. Soc. London 30: 291 (1874) | 8
Lecythidaceae | Asteranthos | Desf. | Asteranthos Desf. | Mém. Mus. Hist. Nat. 6: 9 (1820) | 1
Lecythidaceae | Bertholletia | Bonpl. | Bertholletia Bonpl. | F.W.H.A.von Humboldt & A.J.A.Bonpland, Pl. Aequinoct. 1: 122 (1807) | 1
Lecythidaceae | Cariniana | Casar. | Cariniana Casar. | Nov. Stirp. Bras. 4: 35 (1842) | 9
Lecythidaceae | Chytroma | Miers | Chytroma Miers | Trans. Linn. Soc. London 30: 229 (1874) | 18
Lecythidaceae | Corythophora | R.Knuth | Corythophora R.Knuth | H.G.A.Engler (ed.), Pflanzenr., IV, 219a: 50 (1939) | 4
Lecythidaceae | Couratari | Aubl. | Couratari Aubl. | Hist. Pl. Guiane 2: 723 (1775) | 19
Lecythidaceae | Couroupita | Aubl. | Couroupita Aubl. | Hist. Pl. Guiane 2: 708 (1775) | 3
Lecythidaceae | Eschweilera | Mart. ex DC. | Eschweilera Mart. ex DC. | Prodr. 3: 293 (1828) | 71
Lecythidaceae | Guaiania | O.M.Vargas & C.W.Dick | Guaiania O.M.Vargas & C.W.Dick | Harvard Pap. Bot. 29: 171 (2024) | 5
Lecythidaceae | Gustavia | L. | Gustavia L. | Pl. Surin. 12: 17 (1775), nom. cons. | 47
Lecythidaceae | Imbiriba | O.M.Vargas, M.Ribeiro & C.W.Dick | Imbiriba O.M.Vargas, M.Ribeiro & C.W.Dick | Harvard Pap. Bot. 29: 170 (2024) | 7
Lecythidaceae | Lecythis | Loefl. | Lecythis Loefl. | Iter Hispan.: 189 (1758) | 5
Lecythidaceae | Pachylecythis | Ledoux | Pachylecythis Ledoux | Lecointea 2: 2 (1964) | 5
Lecythidaceae | Scottmoria | Cornejo | Scottmoria Cornejo | Harvard Pap. Bot. 29: 172 (2024) | 26
Lecythidaceae | Waimiria | C.W.Dick & O.M.Vargas | Waimiria C.W.Dick & O.M.Vargas | Harvard Pap. Bot. 29: 169 (2024) | 1

## Narrowing down the `powoGenera` search based on a specified genus vector

You may want to retrieve information for just one or a list of accepted genera from a given country (or from a list of countries). Just like before, you only need to define a vector of genus names in the argument `genus` and a vector of country names in the argument `country`. In the example below, see that we have again searched for just the genera Asarum and Bertholletia of the families Aristolochiaceae and Lecythidaceae, but the function only returned the Lecythidaceae genus Bertholletia, because Asarum does not occur in any of the provided list of countries, i.e. Brazil or French Guiana.

    AL <- powoGenera(family = c("Aristolochiaceae", "Lecythidaceae"),
                     genus = c("Asarum", "Bertholletia"),
                     hybrid = FALSE,
                     country = c("Brazil", "French Guiana"),
                     verbose = TRUE,
                     save = FALSE,
                     dir = "results_powoGenera",
                     filename = "genus_country_constrained_search")

TABLE 3. A `powoGenera` search based on specified genus and country vectors.
family | genus | authors | scientific_name | publication | species_number | native_to_country
--- | --- | --- | --- | --- | --- | ---
Lecythidaceae | Bertholletia | Bonpl. | Bertholletia Bonpl. | F.W.H.A.von Humboldt & A.J.A.Bonpland, Pl. Aequinoct. 1: 122 (1807) | 1 | Bolivia, Brazil, Colombia, French Guiana, Guyana, Suriname, Venezuela

## Reference

POWO (2019). “Plants of the World Online. Facilitated by the Royal Botanic Gardens, Kew. Published on the Internet; http://www.plantsoftheworldonline.org/ Retrieved April 2023.”