Skip to content

Commit

Permalink
add check to detect if not same quadrats for sister stems
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentineHerr committed Jan 25, 2024
1 parent 759f22d commit 1ce3a15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions QAQC_reports/GitHubAction_checks.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ mortality,21,error,missingKinFad,stem,"census_status %in% 1 & !duplicated(paste(
mortality,22,error,missingRotLevel,stem,"census_status %in% 1 & !duplicated(paste(tag, StemTag))","paste(tag, StemTag)",stem,"mortality %in% 1 & grepl('\\<R\\>', fad) & is.na(rotting_trunk)","paste(tag, StemTag)",reference %in% current,Check that there is a rot level when R in FAD,Some rot level are missing
mortality,23,error,missingRinFad,stem,"census_status %in% 1 & !duplicated(paste(tag, StemTag))","paste(tag, StemTag)",stem,"mortality %in% 1 & !grepl('\\<R\\>', fad) & !is.na(rotting_trunk)","paste(tag, StemTag)",reference %in% current,Check that there is a R in FAD if a there is rot level ,Some trees with a rot level don't have a R in FAD
both,24,error,quadratIsNA,stem,1:nrow(referenceTable),"paste(tag, StemTag)",stem,is.na(quadrat),"paste(tag, StemTag)",reference %in% current,Check if there is NA in the quadrats,Some stems don't have a quadrat
both,25,error,quadratIsNotTheSameInAllStems,stem,1:nrow(referenceTable),"paste(tag, StemTag)",stem,VIEW IN SCRIPT,"paste(tag, StemTag)",reference %in% current,Check is quadrat is the same in all stems of a tree,Some stems don't have the same quadrats as stems in same tree
4 changes: 2 additions & 2 deletions R_scripts/CI_QAQC_reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ for (i in 1:nrow(checks)) {
referenceTable <- get(referenceTable)
currentTable <- get(currentTable)


#filter rows
referenceTable <- referenceTable[eval(str2lang(referenceTableFilter)), ]
currentTable <- currentTable[eval(str2lang(currentTableFilter)), ]

if(errorName %in% "quadratIsNotTheSameInAllStems") currentTable <- currentTable[,if(uniqueN(quadrat) > 1) .SD, by = tag] else currentTable <- currentTable[eval(str2lang(currentTableFilter)), ]

# select columns
if(!referenceTableSelect %in% "") reference <- referenceTable[, eval(str2lang(referenceTableSelect)) ] else reference <- referenceTable
Expand Down

0 comments on commit 1ce3a15

Please sign in to comment.