From 179c54c80fbb4c0137e48408f75f64efbfe4e596 Mon Sep 17 00:00:00 2001 From: Roger Bivand Date: Fri, 24 Nov 2023 12:57:25 +0100 Subject: [PATCH] suppress warnings in multcomp::glht summary --- DESCRIPTION | 4 ++-- NEWS.md | 6 +++++- R/ML_models.R | 4 ++-- R/SLX_WX.R | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 13f8426..a3b56b0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spatialreg -Version: 1.3-1 -Date: 2023-11-22 +Version: 1.3-2 +Date: 2023-11-24 Title: Spatial Regression Analysis Encoding: UTF-8 Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bivand@nhh.no", comment=c(ORCID="0000-0003-2392-6140")), diff --git a/NEWS.md b/NEWS.md index 56278d0..c6843a5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# Version 1.3-1 (development) +# Version 1.3-2 (development) + +* suppress warning from `multcomp::glht` as the test which throws the warning is discarded + +# Version 1.3-1 (2023-11-23) * move `expm` from Imports to Suggests #42 diff --git a/R/ML_models.R b/R/ML_models.R index c29bf80..5775927 100644 --- a/R/ML_models.R +++ b/R/ML_models.R @@ -300,7 +300,7 @@ errorsarlm <- function(formula, data = list(), listw, na.action, weights=NULL, indirImps <- sum_lm_target$coefficients[(m2+1):m, 1:2, drop=FALSE] rownames(indirImps) <- rownames(cm) } - lc <- summary(multcomp::glht(lm.target, linfct=cm)) + suppressWarnings(lc <- summary(multcomp::glht(lm.target, linfct=cm))) totImps <- cbind("Estimate"=lc$test$coefficients, "Std. Error"=lc$test$sigma) } else if (is.formula(Durbin)) { #FIXME @@ -337,7 +337,7 @@ errorsarlm <- function(formula, data = list(), listw, na.action, weights=NULL, } } rownames(indirImps) <- xn - lc <- summary(multcomp::glht(lm.target, linfct=cm)) + suppressWarnings(lc <- summary(multcomp::glht(lm.target, linfct=cm))) totImps <- cbind("Estimate"=lc$test$coefficients, "Std. Error"=lc$test$sigma) if (!is.null(zero_fill)) { if (length(zero_fill) > 0L) { diff --git a/R/SLX_WX.R b/R/SLX_WX.R index f6af70d..9df273a 100644 --- a/R/SLX_WX.R +++ b/R/SLX_WX.R @@ -137,7 +137,7 @@ lmSLX <- function(formula, data = list(), listw, na.action, weights=NULL, Durbin indirImps <- sum_lm_model$coefficients[(m2+1):m, 1:2, drop=FALSE] rownames(indirImps) <- rownames(cm) } - lc <- summary(multcomp::glht(lm.model, linfct=cm)) + suppressWarnings(lc <- summary(multcomp::glht(lm.model, linfct=cm))) totImps <- cbind("Estimate"=lc$test$coefficients, "Std. Error"=lc$test$sigma) } else if (is.formula(Durbin)) { #FIXME @@ -174,7 +174,7 @@ lmSLX <- function(formula, data = list(), listw, na.action, weights=NULL, Durbin } } rownames(indirImps) <- xn - lc <- summary(multcomp::glht(lm.model, linfct=cm)) + suppressWarnings(lc <- summary(multcomp::glht(lm.model, linfct=cm))) totImps <- cbind("Estimate"=lc$test$coefficients, "Std. Error"=lc$test$sigma) if (!is.null(zero_fill)) {