Closed mattiaghilardi closed 4 months ago
Hello,
clean_names() allows to remove some species epithet designations, such as sp., sp1, sps, but not spp., which indicates several species and I commonly find when working with fish survey data.
clean_names()
sp.
sp1
sps
spp.
taxadb::clean_names(c("Homo sp.", "Homo sp", "Homo sp1", "Homo sps", "Homo spp.", "Homo spp")) #> [1] "homo" "homo" "homo" "homo" "homo spp" "homo spp"
Created on 2024-04-10 with reprex v2.1.0
Would you consider adding this feature?
This modification to the internal drop_sp.() should do it:
drop_sp.()
drop_sp. <- function(x){ # drop: cladophora sp2, cladophora sp., cladophora sps, cladophora sp x <- stringi::stri_replace_all_regex(x, "\\ssp[s\\d\\.]?$", "") # drop: cladophora spp, cladophora spp. stringi::stri_replace_all_regex(x, "\\sspp[\\.]?$", "") }
thanks, nice catch. That's a great idea. A PR would be welcome.
Hello,
clean_names()
allows to remove some species epithet designations, such assp.
,sp1
,sps
, but notspp.
, which indicates several species and I commonly find when working with fish survey data.Created on 2024-04-10 with reprex v2.1.0
Would you consider adding this feature?
This modification to the internal
drop_sp.()
should do it: