diff --git a/NEWS.md b/NEWS.md index c6843a5..67cdc23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # Version 1.3-2 (development) +* re-corrected #19 because the fitted model weights component may be NULL + * suppress warning from `multcomp::glht` as the test which throws the warning is discarded # Version 1.3-1 (2023-11-23) diff --git a/R/sarlm_functions.R b/R/sarlm_functions.R index d97cd8a..cb27ff4 100644 --- a/R/sarlm_functions.R +++ b/R/sarlm_functions.R @@ -249,7 +249,7 @@ print.summary.Sarlm <- function(x, digits = max(5, .Options$digits - 3), format(signif(x$NK, digits)), "\n") cat("Number of observations:", length(x$residuals), "\n") cat("Number of parameters estimated:", x$parameters, "\n") - if (length(unique(x$weights)) == 1L) { + if ((is.null(x$weights) || (!is.null(x$weights) && length(unique(x$weights))) == 1L)) { cat("AIC: ", format(signif(AIC(x), digits)), ", (AIC for lm: ", format(signif(x$AIC_lm.model, digits)), ")\n", sep="") } else {