From c5d951755cd453604066f72c634faa1ad06c08e2 Mon Sep 17 00:00:00 2001
From: biopsichas <svajunas.plunge@gmail.com>
Date: Wed, 26 Jun 2024 14:58:06 +0200
Subject: [PATCH] small bug in phu

---
 R/plot_mgt_harv.R | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R/plot_mgt_harv.R b/R/plot_mgt_harv.R
index 52db5c8..c4f6a93 100644
--- a/R/plot_mgt_harv.R
+++ b/R/plot_mgt_harv.R
@@ -275,7 +275,7 @@ prepare_phu <- function(mgt_out, years) {
     ungroup() %>%
     filter(year %in% years)
 
-  if(any(phu_tbl$date_diff > 1)) {
+  if(any(phu_tbl$date_diff > 1, na.rm = TRUE)) {
     crop_diff <- phu_tbl %>%
       filter(operation == 'KILL') %>%
       filter(date_diff > 1) %>%
-- 
GitLab