Skip to contents

[Stable] This function tibble object with all the columns of input table of taxa plus new columns such as valid_name, valid_authority, valid_AphiaID, status, synonyms, LSID, url, matchType, nOfWormsRecords, wormsRecords obtained from: Worms rest API.

Usage

taxon_id_worms(input, taxaColumn = 1, verbose = TRUE, refine = FALSE)

Arguments

input

A tibble. The table that contain the species names list to be checked.

taxaColumn

A numeric. The cardinal number of the column where species list is. Default is 1.

verbose

A logical. Whit this selection, the function returns a message with number of record(s) that don't match with any Worms names and the number of record(s) that match with more that one Worms name. Default is TRUE.

refine

A logical. With this selection, the function allows to refine the result(s) that match with more Worms records. By a interactive use of the terminal, the user can chose the result. Default is FALSE.

Value

The output of the function is a tibble with the columns provided and new columns such as: valid_name, valid_authority, valid_AphiaID, status, synonyms, LSID, url, matchType, nOfWormsRecords, wormsRecords obtained by Worms rest API. The function also return, if verbose is TRUE, the list of records that don't match with Worms name species.

References

Chamberlain S (2020). worrms: World Register of Marine Species (WoRMS) Client. R package version 0.4.2, https://CRAN.R-project.org/package=worrms.

Wickham H, François R, Henry L, Müller K (2022). dplyr: A Grammar of Data Manipulation. R package version 1.0.9, https://CRAN.R-project.org/package=dplyr.

Author

Alessandro Oggioni, phD (2021) oggioni.a@irea.cnr.it

Paolo Tagliolato, phD (2021) tagliolato.p@irea.cnr.it

Examples

phytoplankton <- tibble::tibble(
   ID = c(1, 2, 3, 4, 5, 6, 7),
   species = c(
   "Asterionella formosa", "Chrysococcus sp.",
   "Cryptomonas rostrata", "Dinobryon divergens",
   "Mallomonas akrokomos", "Melosira varians",
   "Cryptomonas rostrata"
 )
)
table <- taxon_id_worms(
  input = phytoplankton,
  taxaColumn = 2,
  verbose = TRUE,
  refine = TRUE
)
#> 
#> After the finding operation the number of record(s) that don't match
#> with any Worms names are:
#> *--- 0 on 7 examined ---*
#> please verify the species name provided and run again this
#> function. The record(s) that match with more that one Worms name are:
#> *--- 7 on 7 examined ---*
#> please use the function taxon_id_worms_refine for specify wich
#> is the exact corrispondence with your given species name.
#> This is the taxa name provided by you:
#> Cryptomonas rostrata
#> Worms don't contain a unique records that match with this name.
#> The Worms records most similar are:
#> 
#> 1:  Cryptomonas rostrata (Skuja, 1948)
#>     Worms status: accepted
#>     Unaccept reason: NA
#>     Match type: exact
#>     Modified: 2015-06-26T12:14:04.327Z
#> 2:  Cryptomonas rostrata (O.V.Troitzkaja, 1922)
#>     Worms status: unaccepted
#>     Unaccept reason: synonym
#>     Match type: exact
#>     Modified: 2021-08-27T06:27:33.180Z
#> 
#> ----
#> Please select the record that you think
#> most similar to the taxa name that you have provided.
#> Insert the number of record:
#> This is the taxa name provided by you:
#> Cryptomonas rostrata
#> Worms don't contain a unique records that match with this name.
#> The Worms records most similar are:
#> 
#> 1:  Cryptomonas rostrata (Skuja, 1948)
#>     Worms status: accepted
#>     Unaccept reason: NA
#>     Match type: exact
#>     Modified: 2015-06-26T12:14:04.327Z
#> 2:  Cryptomonas rostrata (O.V.Troitzkaja, 1922)
#>     Worms status: unaccepted
#>     Unaccept reason: synonym
#>     Match type: exact
#>     Modified: 2021-08-27T06:27:33.180Z
#> 
#> ----
#> Please select the record that you think
#> most similar to the taxa name that you have provided.
#> Insert the number of record:
table
#> # A tibble: 7 × 12
#>      ID species       valid…¹ valid…² valid…³ status synon…⁴ LSID  url   match…⁵
#>   <dbl> <chr>         <chr>   <chr>     <int> <chr>  <chr>   <chr> <chr> <chr>  
#> 1     1 Asterionella… Asteri… Hassal…  148954 accep… NA      urn:… http… exact  
#> 2     2 Chrysococcus… NA      NA           NA NA     NA      NA    NA    NA     
#> 3     3 Cryptomonas … NA      NA           NA NA     NA      NA    NA    NA     
#> 4     4 Dinobryon di… Dinobr… O.E.Im…  157248 accep… NA      urn:… http… exact  
#> 5     5 Mallomonas a… Mallom… Ruttne…  249722 accep… NA      urn:… http… exact  
#> 6     6 Melosira var… Melosi… C.Agar…  149043 accep… NA      urn:… http… exact  
#> 7     7 Cryptomonas … NA      NA           NA NA     NA      NA    NA    NA     
#> # … with 2 more variables: nOfWormsResults <dbl>, wormsRecords <list>, and
#> #   abbreviated variable names ¹​valid_name, ²​valid_authority, ³​valid_AphiaID,
#> #   ⁴​synonyms, ⁵​matchType