Skip to content

Commit

Permalink
Update update_inputs.Rmd
Browse files Browse the repository at this point in the history
add explanation #156
  • Loading branch information
jrhillae committed May 21, 2024
1 parent 08c66a4 commit ad8589d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Vespa velutina management/update_inputs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,16 @@ managed_nests <- data_nest_iasset%>%
select(id)
#decide which of both duplicates should be removed
#only remove duplicates which do not have information regarding management
#in case already one of both is missing, maintain the other observation
#only remove duplicates which do not contain information regarding management
#default remove most recent duplicates (ID1)
dupli_nest_iasset <- dupli_nest_iasset%>%
mutate(duplicate_to_remove = case_when(
ID1 %in% dupli_missing_ID1 ~ ID1,
ID2 %in% dupli_missing_ID2 ~ ID2,
(ID1 %in% managed_nests$id) & !(ID2 %in% managed_nests$id) ~ ID2,
(ID2 %in% managed_nests$id) & !(ID1 %in% managed_nests$id) ~ ID1,
TRUE ~ ID2))
TRUE ~ ID1))
data_nest_iasset <- data_nest_iasset %>%
filter(!id %in% dupli_nest_iasset$duplicate_to_remove)
```
Expand Down

0 comments on commit ad8589d

Please sign in to comment.