From a5b1019eb4e222a842ddf0105f8c5059b5948597 Mon Sep 17 00:00:00 2001 From: SarahJWeisberg Date: Wed, 30 Oct 2024 13:32:20 -0400 Subject: [PATCH] adding negative diet check --- R/param.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/R/param.R b/R/param.R index 41e33fe..1e0abfd 100644 --- a/R/param.R +++ b/R/param.R @@ -375,6 +375,14 @@ check.rpath.params <- function(Rpath.params){ w <- w + 1 } + # Check if any diet value is < 0 + dietDF <- data.frame(Rpath.params$diet) + dietDF[is.na(dietDF)] <- 0 + if (any(dietDF<0)) { + warning('Found a negative diet value. Please make sure no diet values are negative.') + w <- w + 1 + } + if(w == 0){ cat('Rpath parameter file is functional. \n') } else {