EcologicalTraitData / traitdataform

A package to manage and compile functional trait data into predefined templates
https://ecologicaltraitdata.github.io/traitdataform/
Other
33 stars 9 forks source link

standardize.taxonomy with subspecies names #17

Closed RS-eco closed 6 years ago

RS-eco commented 7 years ago

Ich versuche die function standardize.taxonomy am passerines datensatz anzuwenden. Leider bricht der Function call standardize.taxonomy bei der Species (Acrocephalus familiaris kingi) ab. Hier der Code dafür:

library(traitdataform)
# Merge Genus and Species into one column
passerines <- tidyr::unite(passerines, Genus, Species, col="scientificName", sep=" ")
# Separate species and subspecies by " " rather than "_"
passerines$scientificName <- sapply(passerines$scientificName, function(x) paste0(strsplit(x, split="_")[[1]][1:2], collapse=" "))
passerines$scientificName <- factor(passerines$scientificName)
passerines_std <- standardize.taxonomy(passerines, return="scientificNameStd")

Vielen Dank für deine Hilfe.

fdschneider commented 6 years ago

works now by default. Optionally: If the function call sets subspecies = FALSE all subspecies names will be mapped to species level.