From 3fbf6551c7466a0e7f92ae90d65dd8de02b4ff7a Mon Sep 17 00:00:00 2001 From: mitchelloharawild Date: Tue, 17 Sep 2024 11:28:07 +1000 Subject: [PATCH] support() default method now uses open limits when density fails --- R/default.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/default.R b/R/default.R index a807102..160b557 100755 --- a/R/default.R +++ b/R/default.R @@ -80,7 +80,9 @@ support.dist_default <- function(x, ...) { closed <- if(any(is.na(lims))) { c(FALSE, FALSE) } else { - !near(density(x, lims), 0) + # Default to open limits on error + lim_dens <- tryCatch(density(x, lims), error = function(e) c(0,0)) + !near(lim_dens, 0) } new_support_region( list(vctrs::vec_init(generate(x, 1), n = 0L)),