From 0cbef2a29a1a82ac6c649c7dd6a9924de6b30fb6 Mon Sep 17 00:00:00 2001 From: Francesco Sabatini <francesco.sabatini@idiv.de> Date: Fri, 6 Mar 2020 11:42:13 +0100 Subject: [PATCH] Minor changes to Taxonomic Backbone --- code/03_TaxonomicBackbone.Rmd | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/03_TaxonomicBackbone.Rmd b/code/03_TaxonomicBackbone.Rmd index d58c2a8..b9a057f 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) %>% -- GitLab