diff --git a/DESCRIPTION b/DESCRIPTION index 62356eb..1e0a96e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spatialreg Version: 1.3-5 -Date: 2024-08-04 +Date: 2024-08-19 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 2cfd31c..87577c0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # Version 1.3-5 (development) +* adding missing man page anchors + +* conforming with STRICT_R_HEADERS=1 + * Condition on forthcoming `tmap` 4 * #52 subgraph updates diff --git a/man/SpatialFiltering.Rd b/man/SpatialFiltering.Rd index f1aa340..21552fe 100644 --- a/man/SpatialFiltering.Rd +++ b/man/SpatialFiltering.Rd @@ -52,7 +52,7 @@ SpatialFiltering(formula, lagformula=NULL, data=list(), na.action=na.fail, \references{Tiefelsdorf M, Griffith DA. (2007) Semiparametric Filtering of Spatial Autocorrelation: The Eigenvector Approach. Environment and Planning A, 39 (5) 1193 - 1221.} \author{Yongwan Chun, Michael Tiefelsdorf, Roger Bivand} -\seealso{\code{\link[stats]{lm}}, \code{\link[base]{eigen}}, \code{\link{nb2listw}}, \code{\link{listw2U}}} +\seealso{\code{\link[stats]{lm}}, \code{\link[base]{eigen}}, \code{\link[spdep]{nb2listw}}, \code{\link[spdep]{listw2U}}} \examples{ require("sf", quietly=TRUE) columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE) diff --git a/man/impacts.Rd b/man/impacts.Rd index 06628d1..e6020b4 100644 --- a/man/impacts.Rd +++ b/man/impacts.Rd @@ -91,7 +91,7 @@ Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation M \seealso{ -\code{\link{trW}}, \code{\link{lagsarlm}}, \code{\link{nb2listw}}, \code{\link[MASS]{mvrnorm}}, \code{\link[coda]{plot.mcmc}}, \code{\link[coda]{summary.mcmc}}, \code{\link[coda]{HPDinterval}} +\code{\link{trW}}, \code{\link{lagsarlm}}, \code{\link[spdep]{nb2listw}}, \code{\link[MASS]{mvrnorm}}, \code{\link[coda]{plot.mcmc}}, \code{\link[coda]{summary.mcmc}}, \code{\link[coda]{HPDinterval}} } \examples{ require("sf", quietly=TRUE) diff --git a/man/invIrM.Rd b/man/invIrM.Rd index 992fc85..b8e9201 100644 --- a/man/invIrM.Rd +++ b/man/invIrM.Rd @@ -20,7 +20,7 @@ invIrW(x, rho, method="solve", feasible=NULL) \item{style}{\code{style} can take values W, B, C, and S} \item{method}{default \code{solve}, can also take value \code{chol}} \item{feasible}{if NULL, the given value of rho is checked to see if it lies within its feasible range, if TRUE, the test is not conducted} - \item{x}{either a \code{listw} object from for example \code{nb2listw}, or a square spatial weights matrix, optionally a sparse matrix} + \item{x}{either a \code{listw} object from for example \code{nb2listw} or a square spatial weights matrix, optionally a sparse matrix} } \details{ The \code{invIrW} function generates the full weights matrix V, checks that rho lies in its feasible range between 1/min(eigen(V)) and 1/max(eigen(V)), and returns the nxn inverted matrix \deqn{(I - \rho V)^{-1}}. With method=\dQuote{chol} (only for a listw object), Cholesky decomposition is used, thanks to contributed code by Markus Reder and Werner Mueller. @@ -38,7 +38,7 @@ Before version 0.6-10, \code{powerWeights} only worked correctly for positive rh \references{Tiefelsdorf, M., Griffith, D. A., Boots, B. 1999 A variance-stabilizing coding scheme for spatial link matrices, Environment and Planning A, 31, pp. 165-180; Tiefelsdorf, M. 2000 Modelling spatial processes, Lecture notes in earth sciences, Springer, p. 76; Haining, R. 1990 Spatial data analysis in the social and environmental sciences, Cambridge University Press, p. 117; Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 152; Reder, M. and Mueller, W. (2007) An Improvement of the invIrM Routine of the Geostatistical R-package spdep by Cholesky Inversion, Statistical Projects, LV No: 238.205, SS 2006, Department of Applied Statistics, Johannes Kepler University, Linz} \author{Roger Bivand \email{Roger.Bivand@nhh.no}} -\seealso{\code{\link{nb2listw}}} +\seealso{\code{\link[spdep]{nb2listw}}} \examples{ library(spdep) diff --git a/man/trW.Rd b/man/trW.Rd index 5243f32..f833852 100644 --- a/man/trW.Rd +++ b/man/trW.Rd @@ -34,7 +34,7 @@ A numeric vector of \code{m} traces, with \dQuote{timings} and \dQuote{type} att \seealso{ -\code{\link{as_dgRMatrix_listw}}, \code{\link{nb2listw}} +\code{\link{as_dgRMatrix_listw}}, \code{\link[spdep]{nb2listw}} } \examples{ require("sf", quietly=TRUE) diff --git a/src/ml_sse.c b/src/ml_sse.c index 4ec957e..9835ac3 100644 --- a/src/ml_sse.c +++ b/src/ml_sse.c @@ -1,4 +1,4 @@ -/* Copyright 2010 by Roger S. Bivand. */ +/* Copyright 2010-24 by Roger S. Bivand. */ #include "spatialreg.h" @@ -46,7 +46,7 @@ SEXP opt_error_init(void) { /* -Wstrict-prototypes */ OPT_ERROR_SSE *pt; SEXP ptr; - pt = Calloc(1, OPT_ERROR_SSE); + pt = R_Calloc(1, OPT_ERROR_SSE); pt->set = FALSE; PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue)); @@ -76,18 +76,18 @@ void opt_error_set(SEXP env) { PROTECT(wy = findVarInFrame(env, install("wy"))); pc++; PROTECT(WX = findVarInFrame(env, install("WX"))); pc++; - pt->y = Calloc(n, double); - pt->x = Calloc(np, double); - pt->yl = Calloc(n, double); - pt->wy1 = Calloc(n, double); - pt->xlq = Calloc(np, double); - pt->wx1 = Calloc(np, double); - pt->qy = Calloc(np, double); - pt->xlqyl = Calloc(p, double); - pt->jpvt = Calloc(p, int); - pt->work = Calloc(p*2, double); -/* pt->work = Calloc(p, double); */ - pt->qraux = Calloc(p, double); + pt->y = R_Calloc(n, double); + pt->x = R_Calloc(np, double); + pt->yl = R_Calloc(n, double); + pt->wy1 = R_Calloc(n, double); + pt->xlq = R_Calloc(np, double); + pt->wx1 = R_Calloc(np, double); + pt->qy = R_Calloc(np, double); + pt->xlqyl = R_Calloc(p, double); + pt->jpvt = R_Calloc(p, int); + pt->work = R_Calloc(p*2, double); +/* pt->work = R_Calloc(p, double); */ + pt->qraux = R_Calloc(p, double); for (i=0; iy[i] = NUMERIC_POINTER(y)[i]; @@ -110,19 +110,19 @@ SEXP opt_error_free(SEXP ptr) { pt = (OPT_ERROR_SSE *) R_ExternalPtrAddr(ptr); - Free(pt->qraux); - Free(pt->work); - Free(pt->jpvt); - Free(pt->xlqyl); - Free(pt->qy); - Free(pt->wx1); - Free(pt->xlq); - Free(pt->wy1); - Free(pt->yl); - Free(pt->x); - Free(pt->y); - - Free(pt); + R_Free(pt->qraux); + R_Free(pt->work); + R_Free(pt->jpvt); + R_Free(pt->xlqyl); + R_Free(pt->qy); + R_Free(pt->wx1); + R_Free(pt->xlq); + R_Free(pt->wy1); + R_Free(pt->yl); + R_Free(pt->x); + R_Free(pt->y); + + R_Free(pt); R_ClearExternalPtr(ptr); return(R_NilValue); } @@ -132,7 +132,7 @@ SEXP hess_error_init(void) { /* -Wstrict-prototypes */ HESS_ERROR_SSE *pt; SEXP ptr; - pt = Calloc(1, HESS_ERROR_SSE); + pt = R_Calloc(1, HESS_ERROR_SSE); pt->set = FALSE; PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue)); @@ -162,14 +162,14 @@ void hess_error_set(SEXP env) { PROTECT(wy = findVarInFrame(env, install("wy"))); pc++; PROTECT(WX = findVarInFrame(env, install("WX"))); pc++; - pt->y = Calloc(n, double); - pt->x = Calloc(np, double); - pt->yl = Calloc(n, double); - pt->wy1 = Calloc(n, double); - pt->xl = Calloc(np, double); - pt->wx1 = Calloc(np, double); - pt->beta1 = Calloc(p, double); - pt->xlb = Calloc(n, double); + pt->y = R_Calloc(n, double); + pt->x = R_Calloc(np, double); + pt->yl = R_Calloc(n, double); + pt->wy1 = R_Calloc(n, double); + pt->xl = R_Calloc(np, double); + pt->wx1 = R_Calloc(np, double); + pt->beta1 = R_Calloc(p, double); + pt->xlb = R_Calloc(n, double); for (i=0; iy[i] = NUMERIC_POINTER(y)[i]; @@ -192,16 +192,16 @@ SEXP hess_error_free(SEXP ptr) { pt = (HESS_ERROR_SSE *) R_ExternalPtrAddr(ptr); - Free(pt->xlb); - Free(pt->beta1); - Free(pt->wx1); - Free(pt->xl); - Free(pt->wy1); - Free(pt->yl); - Free(pt->x); - Free(pt->y); + R_Free(pt->xlb); + R_Free(pt->beta1); + R_Free(pt->wx1); + R_Free(pt->xl); + R_Free(pt->wy1); + R_Free(pt->yl); + R_Free(pt->x); + R_Free(pt->y); - Free(pt); + R_Free(pt); R_ClearExternalPtr(ptr); return(R_NilValue); } @@ -211,7 +211,7 @@ SEXP hess_lag_init(void) { /* -Wstrict-prototypes */ HESS_LAG_SSE *pt; SEXP ptr; - pt = Calloc(1, HESS_LAG_SSE); + pt = R_Calloc(1, HESS_LAG_SSE); pt->set = FALSE; PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue)); @@ -240,12 +240,12 @@ void hess_lag_set(SEXP env) { PROTECT(x = findVarInFrame(env, install("x"))); pc++; PROTECT(wy = findVarInFrame(env, install("wy"))); pc++; - pt->y = Calloc(n, double); - pt->x = Calloc(np, double); - pt->yl = Calloc(n, double); - pt->wy1 = Calloc(n, double); - pt->beta1 = Calloc(p, double); - pt->xb = Calloc(n, double); + pt->y = R_Calloc(n, double); + pt->x = R_Calloc(np, double); + pt->yl = R_Calloc(n, double); + pt->wy1 = R_Calloc(n, double); + pt->beta1 = R_Calloc(p, double); + pt->xb = R_Calloc(n, double); for (i=0; iy[i] = NUMERIC_POINTER(y)[i]; @@ -265,14 +265,14 @@ SEXP hess_lag_free(SEXP ptr) { pt = (HESS_LAG_SSE *) R_ExternalPtrAddr(ptr); - Free(pt->xb); - Free(pt->beta1); - Free(pt->wy1); - Free(pt->yl); - Free(pt->x); - Free(pt->y); + R_Free(pt->xb); + R_Free(pt->beta1); + R_Free(pt->wy1); + R_Free(pt->yl); + R_Free(pt->x); + R_Free(pt->y); - Free(pt); + R_Free(pt); R_ClearExternalPtr(ptr); return(R_NilValue); }