-
Notifications
You must be signed in to change notification settings - Fork 0
/
review_heliconia_data.R
85 lines (52 loc) · 2.97 KB
/
review_heliconia_data.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
review_heliconia_data <- function() {
library(tidyverse)
# load the complete and clean Heliconia dataset ---------------------------
ha_data<-read_csv("./data/survey_clean/heliconia_survey_clean.csv",
show_col_types = FALSE)
# check for zombie plants ------------------------------------------------
# Zombie Plants are plants that were marked dead in year t but with
# a measurement of shts or ht in a subsequent year, indicating they had
# lost above-ground parts but were still alive. This function identifies
# them, corrects those that are simple to correct, and then saves a csv
# file with those that should be reviewed in the original records
# and corrected in the correction file.
# A message will inform if there are NO zombies in the dataset
source("./code/survey_review/find_zombies.R")
find_zombies(ha_data)
# check for duplicate plant_id numbers -----------------------------
# This will check for duplicated plant_id numbers.
# Any found will be saved for review in a csv file
# A message will inform if there are NO duplicate plant_id numbers
source("./code/survey_review/find_dupe_id.R")
find_dupe_id(ha_data)
# Save CSV of plants that were not on the survey list ---------------------
# Sometimes the team conducting the survey will find a plant that is not on the
# list of plants to be recorded. This is usually because it was marked dead
# in a previous year but re-sprouted. (This is why we leave plants with their
# numbered stake until they have been recorded "dead" >1 time).
#
# This function will find any any that were not on the survey list and save
# them in a csv file to allow going back through surveys to figure out what
# happened
# A message will inform if there are NO plants in the dataset that weren't
# on the survey list taken to the field.
source("./code/survey_review/find_not_listed.R")
find_not_listed(ha_data)
# Find duplicate tag numbers ----------------------------------------------
# occasionally a member of the survey team will write down or read out a
# tag number incorrectly. The function `detect_duplicate_plants.R` will
# identify them and save as a csv file, which will allow for
# reviewing the original records to sort the duplicates out
# records. It will also return the demographic data file
# with the duplicate tag numbers labeled in a new column
source("./code/survey_review/find_dupe_tags.R")
find_dupe_tags(ha_data)
# This will give you a list of the individual plants with duplicated tag
# numbers and the plot in which they are located
# find "adult plants" without a tag ----------------------------------------
source("./code/survey_review/find_no_tags.R")
find_no_tags(ha_data)
# find plants with census_status = "measured" but no recorded ht or shts ---
source("./code/survey_review/find_plants_no_size.R")
find_plants_no_size(ha_data)
}