Skip to content

ALL - missing sample check #90

@stephpenn1

Description

@stephpenn1

Example missing sample check from TCTN, fill in with analyte-specific column names:

# 5. Check with Metadata for missing:

source("./Processing_Scripts/Metadata_kit_list.R")

metadata_collected %>%
  filter(sample_method == "jar", transect_location != "sediment") -> meta_filter

data_clean %>%
  full_join(meta_filter, by = c("campaign", "kit_id", "transect_location"))  %>%
  # add rows for samples not collected, creating a "full" dataset of all possible samples
  mutate(tc_flag = case_when(collected == FALSE & is.na(carbon_weight_perc) & is.na(tc_flag) ~ "sample not collected",
                             notes == "kit compromised" ~ "kit compromised",
                             notes == "sample compromised" ~ "sample compromised",
                             TRUE ~ tc_flag),
         tn_flag = case_when(collected == FALSE & is.na(nitrogen_weight_perc) & is.na(tn_flag) ~ "sample not collected",
                             notes == "kit compromised" ~ "kit compromised",
                             notes == "sample compromised" ~ "sample compromised",
                             TRUE ~ tn_flag),
         carbon_weight_perc = case_when(notes == "kit compromised" ~ NA,
                                        notes == "sample compromised" ~ NA,
                                        TRUE ~ carbon_weight_perc),
         nitrogen_weight_perc = case_when(notes == "kit compromised" ~ NA,
                                          notes == "sample compromised" ~ NA,
                                          TRUE ~ nitrogen_weight_perc)) %>% 
  select(-c(sample_type, sample_method, collected, notes)) -> tctn_full

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions