From 2316c845c7af2fd1d2c86636e492e3db163eef57 Mon Sep 17 00:00:00 2001 From: Francesco Sabatini <francesco.sabatini@idiv.de> Date: Wed, 18 Mar 2020 12:26:27 +0100 Subject: [PATCH] Added code to exclude unreliable plots from Canada - Not knitted! --- code/04_buildHeader.Rmd | 24 ++++++++++++++++++++---- code/06_buildDT.Rmd | 8 ++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/code/04_buildHeader.Rmd b/code/04_buildHeader.Rmd index 4e09436..6228c22 100644 --- a/code/04_buildHeader.Rmd +++ b/code/04_buildHeader.Rmd @@ -6,11 +6,12 @@ output: html_document --- - <center>  </center> +MEMO : Exclude plots from CANADA and adjust DT2, CWMs & SoilClim (at the moment code is here, but eval=F) +\newline **Timestamp:** `r date()` **Drafted:** Francesco Maria Sabatini @@ -96,7 +97,7 @@ header0 <- readr::read_delim("../sPlot_data_export/sPlot_3_0_2_header_test.csv", COMMUNITY = col_character(), SUBSTRATE = col_character(), Locality = col_character(), - ORIG_NUM = col_double(), + ORIG_NUM = col_character(), ALLIAN_REV = col_character(), REV_AUTHOR = col_character(), Forest = col_logical(), @@ -133,10 +134,25 @@ The following column names occurred in the header of sPlot v2.1 and are currentl 10. POINT_X 11. POINT_Y ~~ -Columns #1, #2, #3, #10, #11 will be dropped. The others will be derived below. +Columns #1, #2, #3, #10, #11 will be dropped. The others will be derived below. + + +### 1.1 Exclude unreliable plots +Some canadian plots need to be removed, on indication of [Laura Boisvert-Marsh](laura.boisvert-marsh@canada.ca) from GIVD NA-CA-004. The plots (and corresponding `PlotObservationID`) are: +\newline + +Fabot01 - 1707776 +Fadum01, 02 & 03 - 1707779:1707781 +Faers01 - 1707782 +Pfe-f-08 - 1707849 +Pfe-o-05- 1707854 +```{r, eval=F} +header0 <- header0 %>% + filter(PlotObservationID != c(1707776, 1707779:1707782, 1707849, 1707854)) +``` -### 1.1 Solve spatial problems +### 1.2 Solve spatial problems There are 2020 plots in the Nile dataset without spatial coordinates. Assign manually with wide (90km) location uncertainty. ```{r} header <- header0 %>% diff --git a/code/06_buildDT.Rmd b/code/06_buildDT.Rmd index d8eeab1..876ab29 100644 --- a/code/06_buildDT.Rmd +++ b/code/06_buildDT.Rmd @@ -67,6 +67,14 @@ DT0 <- readr::read_delim("../sPlot_data_export/sPlot_3_0_2_species_test.csv", nplots <- length(unique(DT0$PlotObservationID)) nspecies <- length(unique(DT0$`Matched concept`)) ``` +Match plots with those in `header` +```{r} +load("../_output/header_sPlot3.0.RData") +DT0 <- DT0 %>% + filter(PlotObservationID %in% unique(header$PlotObservationID)) +``` + + Species data include `r nrow(DT0)` species * plot records, across `r nplots` plots. Before taxonomic resolution, there are `r nspecies` species . \newline -- GitLab