From 0d560e115753b64b12fd98f0a196b213614b1c5b Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Wed, 23 Oct 2024 10:36:13 -0700 Subject: [PATCH] fetchSOLUS: handle 1 or fewer values in interpolation --- R/fetchSOLUS.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/fetchSOLUS.R b/R/fetchSOLUS.R index 0fa282c5..9369788e 100644 --- a/R/fetchSOLUS.R +++ b/R/fetchSOLUS.R @@ -335,7 +335,7 @@ fetchSOLUS <- function(x = NULL, h2 <- h[, data.frame(top = mindep:(maxdep - 1), bottom = (mindep + 1):maxdep, lapply(.SD, function(x) { - if (all(is.na(x))) + if (sum(!is.na(x)) <= 1) return(rep(NA_real_, length(xx))) FUN(y, x, method = method)(xx) })),