diff --git a/code/03_TaxonomicBackbone.Rmd b/code/03_TaxonomicBackbone.Rmd index d58c2a83a0d7f1a48167df9f95f11eaa75163b22..b9a057fd7173db9b8a003ab4907965624685433a 100644 --- a/code/03_TaxonomicBackbone.Rmd +++ b/code/03_TaxonomicBackbone.Rmd @@ -69,7 +69,6 @@ DT0 <- readr::read_delim("../sPlot_data_export/sPlot_3_0_2_species_test.csv", x_ = col_double() ) ) - ``` Create list of species, and exclude fungi ```{r eval=T, echo=F} @@ -167,8 +166,16 @@ knitr::kable(spec.list.TRY.sPlot %>% Stripping unwanted characters as well as abbreviation (such as hybrid markers) which would prevent name matching: ```{r} +#Ancillary function to change to lower case +firstup <- function(x) { + substr(x, 1, 1) <- toupper(substr(x, 1, 1)) + x +} + spec.list.TRY.sPlot <- spec.list.TRY.sPlot %>% mutate(OriginalNames=Species) %>% + mutate(Species=tolower(Species)) %>% + mutate(Species=firstup(Species)) %>% dplyr::select(OriginalNames, Species, Source) %>% mutate(Species=gsub('*', '', Species, fixed=TRUE)) %>% mutate(Species=gsub('cf. ', '', Species, fixed=TRUE)) %>% @@ -433,11 +440,6 @@ save(tnrs.res.certain, tnrs.res.uncertain, file="../_derived/TNRS_submit/tnrs.it ### Manual cleaning, delete subspecies information and rerun match in TNRS Many unmatched records do contain subspecies information which could not be retrieved in TNRS, although genus and species seem to be spelled correctly. Also, sometimes the mismatch derives from having the word 'species' or 'sp' at the end of the name. ```{r} -#Ancillary function to change to lower case -firstup <- function(x) { - substr(x, 1, 1) <- toupper(substr(x, 1, 1)) - x -} #Manual cleaning tnrs.submit.iter2 <- data.frame(old=tnrs.res.uncertain$Name_submitted) %>% mutate(new=old) %>%