Open MarcRieraDominguez opened 8 months ago
Hi Marc,
For synonyms, you can use the wcvp_accepted_id
field in the output to link to the accepted names.
For example, in this case you could use
rWCVP::wcvp_match_names(data.frame(species.test = "Abelia triflora"),
name_col = "species.test",
id_col = NULL, author_col = NULL,
join_cols = NULL, fuzzy = TRUE,
progress_bar = TRUE) %>%
dplyr::left_join(
rWCVPdata::wcvp_names %>% select(wcvp_accepted_id = plant_name_id,
wcvp_accepted_name = taxon_name)
)
which appends the accepted name to the dataframe:
species.test match_type multiple_matches match_similarity match_edit_distance wcvp_id
1 Abelia triflora Exact (without author) FALSE 1 0 2609524
wcvp_name wcvp_authors wcvp_rank wcvp_status wcvp_homotypic wcvp_ipni_id wcvp_accepted_id
1 Abelia triflora R.Br. ex Wall. Species Synonym TRUE 148232-1 2470477
wcvp_accepted_name
1 Zabelia triflora
Regarding your other question, we do not support distribution information for synonyms, and do not automatically resolve synonyms as part of this process. The main reason for this is that treatment of synonyms is going to vary depending on what you are using the data for, and the type of synonym. In your example, A. triflora is a homotypic synonym of Z. triflora, which makes things easier, but for heterotypic synonyms, it becomes important to know what species concept you are dealing with. If Z. triflora had been 'lumped' into another species, should rWCVP
automatically return the distribution of the old species concept, or the new one, which might be much larger? It gets even trickier when we think abut splitting species... The WCVP only includes distribution information for Accepted (and some Unplaced) species, so there is no snapshot of the 'distribution at the time that this synonym was considered Accepted', if that makes sense?
However, I think we can make this a more useful error message. For example:
! Distribution data not available for synonyms; please use the accepted taxon name.
ℹ The name 'Abelia triflora' is a homotypic synonym of 'Zabelia triflora' in this version of the WCVP (v12).
or, for a heterotypic synonym:
! Distribution data not available for synonyms; please use the accepted taxon name.
ℹ The name 'Name one' is a heterotypic synonym of 'Name two' in this version of the WCVP (v12).
Note that for heterotypic synonyms, the distribution of 'Name two' might be different from the species
concept represented by 'Name one'.
Do you think that is more helpful, especially if we included the accompanying explanation in the Details section of the help pages?
Hi Matilda, Sorry for the late reply! Thank you for your suggestions, that join made my life easier :) I understand about the distribution data, and I think that more detailed error messages would be very helpful! Perhaps a third type of error message could be considered when the user has supplied a name that is not in WVCVP (something like Treebeard sp.). Admittedly though, it's unlikely that someone jumps into requesting distribution without having checked the names first. Happy Easter!
Hi! Congratulations for the great package! I am experimenting with it to recover species' distributions, and I came across a difficulty: how to resolve synonyms programatically? The
wcvp_match_names()
function informs the user of whether the supplied name is a synonym, but it does not provide the accepted name.For example, Abelia triflora (https://powo.science.kew.org/taxon/urn:lsid:ipni.org:names:148232-1), which is a synonym of Zabelia triflora (https://powo.science.kew.org/taxon/urn:lsid:ipni.org:names:150126-1). I can tell that Abelia triflora is a synonym by using
wcvp_match_names()
, but I lacked information to resolve the synonymy programatically.Moreover,
wcvp_distribution()
only accepts as inputs a species name, which implies ignoring the wealth of information provided bywcvp_match_names()
: author names, numerical ID codes. I supposewcvp_distribution()
resolves the supplied names to Accepted, or Artificial Hybrid, or the appropiate Synonym (I haven't looked at the source code, lazy me xd). Could thewcvp_distribution()
be enhanced to provide the user with more control on what is being searched?I have used rWCVPdata_0.4.1, rWCVP_1.2.6.
Many thanks in advance!
Created on 2024-03-14 with reprex v2.0.2