From c8da749090fecfb5c4f87ba27f8929638f956799 Mon Sep 17 00:00:00 2001 From: Thomas Nagler Date: Tue, 14 Nov 2023 19:21:54 +1100 Subject: [PATCH] fix na handling in vine() control checks (#266) Co-authored-by: tnagler --- R/tools.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tools.R b/R/tools.R index 669a03e..f2f8dc5 100644 --- a/R/tools.R +++ b/R/tools.R @@ -246,12 +246,12 @@ check_margin_controls <- function(data, ctrl) { } } if (!is.nan(ctrl$xmin[k])) { - if (any(data[, k] < ctrl$xmin[k])) { + if (any(data[, k] < ctrl$xmin[k], na.rm = TRUE)) { stop(msg_var, "not all data are larger than xmin.") } } if (!is.nan(ctrl$xmax[k])) { - if (any(data[, k] > ctrl$xmax[k])) { + if (any(data[, k] > ctrl$xmax[k], na.rm = TRUE)) { stop(msg_var, "not all data are samller than xmax.") } }