Skip to content

Commit

Permalink
copy failsafe from migration to residency
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomflavio committed Nov 12, 2024
1 parent 58fd4e3 commit 5e4f898
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion R/migration.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ migration <- function(
aux <- sectionMovements(movements = movements[[i]], spatial = spatial,
valid.dist = attributes(dist.mat)$valid)

# interesting... why do I have this if here but not on residency? hm...
if (!is.null(aux)) {
# don't run the minimum total detections check here (i.e. set it to 0);
# that's already done when compiling the array movements.
Expand Down
17 changes: 13 additions & 4 deletions R/residency.R
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,21 @@ residency <- function(

aux <- sectionMovements(movements = movements[[i]], spatial = spatial, valid.dist = attributes(dist.mat)$valid)

aux <- checkMinimumN(movements = aux, tag = tag, min.total.detections = 0, # don't run the minimum total detections check here.
if (!is.null(aux)) {
# don't run the minimum total detections check here (i.e. set it to 0);
# that's already done when compiling the array movements.
aux <- checkMinimumN(movements = aux, tag = tag, min.total.detections = 0,
min.per.event = min.per.event[2], n = counter)

output <- checkSMovesN(secmoves = aux, tag = tag, section.warning = section.warning, section.error = section.error, GUI = GUI,
save.tables.locally = save.tables.locally, n = counter)
return(output)
output <- checkSMovesN(secmoves = aux, tag = tag,
section.warning = section.warning,
section.error = section.error, GUI = GUI,
save.tables.locally = save.tables.locally,
n = counter)
return(output)
} else {
return(NULL)
}
})
names(section.movements) <- names(movements)

Expand Down

0 comments on commit 5e4f898

Please sign in to comment.