From 2b349a32777b37cae13dbbc8b8f69c0028701efc Mon Sep 17 00:00:00 2001 From: Roger Date: Fri, 2 Aug 2024 15:53:18 +0200 Subject: [PATCH] condition on tmap4 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ vignettes/sids_models.Rmd | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d43b01f..62356eb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spatialreg Version: 1.3-5 -Date: 2024-06-14 +Date: 2024-08-04 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 b77ab81..2cfd31c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # Version 1.3-5 (development) +* Condition on forthcoming `tmap` 4 + * #52 subgraph updates # Version 1.3-4 (2024-06-10) diff --git a/vignettes/sids_models.Rmd b/vignettes/sids_models.Rmd index d975482..ae29fdb 100644 --- a/vignettes/sids_models.Rmd +++ b/vignettes/sids_models.Rmd @@ -64,6 +64,7 @@ nc$both <- factor(paste(nc$L_id, nc$M_id, sep=":")) is_tmap <- FALSE if (require(tmap, quietly=TRUE)) is_tmap <- TRUE is_tmap +tmap4 <- packageVersion("tmap") >= "3.99" ``` We will now examine the data set reproduced from Cressie and @@ -161,8 +162,11 @@ summary(ecarIVaw) ```{r, eval=is_tmap, echo=TRUE} nc2$fitIV <- fitted.values(ecarIVaw) -sf_use_s2(FALSE) +if (tmap4) { + tm_shape(nc2) + tm_polygons(fill="fitIV", fill.scale=tm_scale(values="brewer.yl_or_br"), fill.legend=tm_legend(position=tm_pos_in("left", "bottom"), frame=FALSE, item.r = 0), lwd=0.01) +} else { tm_shape(nc2) + tm_fill("fitIV") +} ``` The final figure shows the value of the log likelihood function for the null model (I):