Skip to content

Commit 93683ed

Browse files
committed
fix CRAN STRICT_R_HEADERS
1 parent 2b349a3 commit 93683ed

File tree

7 files changed

+69
-65
lines changed

7 files changed

+69
-65
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: spatialreg
22
Version: 1.3-5
3-
Date: 2024-08-04
3+
Date: 2024-08-19
44
Title: Spatial Regression Analysis
55
Encoding: UTF-8
66
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "[email protected]", comment=c(ORCID="0000-0003-2392-6140")),

NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Version 1.3-5 (development)
22

3+
* adding missing man page anchors
4+
5+
* conforming with STRICT_R_HEADERS=1
6+
37
* Condition on forthcoming `tmap` 4
48

59
* #52 subgraph updates

man/SpatialFiltering.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SpatialFiltering(formula, lagformula=NULL, data=list(), na.action=na.fail,
5252
\references{Tiefelsdorf M, Griffith DA. (2007) Semiparametric Filtering of Spatial Autocorrelation: The Eigenvector Approach. Environment and Planning A, 39 (5) 1193 - 1221.}
5353
\author{Yongwan Chun, Michael Tiefelsdorf, Roger Bivand}
5454

55-
\seealso{\code{\link[stats]{lm}}, \code{\link[base]{eigen}}, \code{\link{nb2listw}}, \code{\link{listw2U}}}
55+
\seealso{\code{\link[stats]{lm}}, \code{\link[base]{eigen}}, \code{\link[spdep]{nb2listw}}, \code{\link[spdep]{listw2U}}}
5656
\examples{
5757
require("sf", quietly=TRUE)
5858
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)

man/impacts.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation M
9191
9292
9393
\seealso{
94-
\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}}
94+
\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}}
9595
}
9696
\examples{
9797
require("sf", quietly=TRUE)

man/invIrM.Rd

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ invIrW(x, rho, method="solve", feasible=NULL)
2020
\item{style}{\code{style} can take values W, B, C, and S}
2121
\item{method}{default \code{solve}, can also take value \code{chol}}
2222
\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}
23-
\item{x}{either a \code{listw} object from for example \code{nb2listw}, or a square spatial weights matrix, optionally a sparse matrix}
23+
\item{x}{either a \code{listw} object from for example \code{nb2listw} or a square spatial weights matrix, optionally a sparse matrix}
2424
}
2525
\details{
2626
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
3838
\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}
3939
\author{Roger Bivand \email{Roger.Bivand@nhh.no}}
4040

41-
\seealso{\code{\link{nb2listw}}}
41+
\seealso{\code{\link[spdep]{nb2listw}}}
4242

4343
\examples{
4444
library(spdep)

man/trW.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ A numeric vector of \code{m} traces, with \dQuote{timings} and \dQuote{type} att
3434

3535

3636
\seealso{
37-
\code{\link{as_dgRMatrix_listw}}, \code{\link{nb2listw}}
37+
\code{\link{as_dgRMatrix_listw}}, \code{\link[spdep]{nb2listw}}
3838
}
3939
\examples{
4040
require("sf", quietly=TRUE)

src/ml_sse.c

+59-59
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010 by Roger S. Bivand. */
1+
/* Copyright 2010-24 by Roger S. Bivand. */
22

33
#include "spatialreg.h"
44

@@ -46,7 +46,7 @@ SEXP opt_error_init(void) { /* -Wstrict-prototypes */
4646
OPT_ERROR_SSE *pt;
4747
SEXP ptr;
4848

49-
pt = Calloc(1, OPT_ERROR_SSE);
49+
pt = R_Calloc(1, OPT_ERROR_SSE);
5050
pt->set = FALSE;
5151

5252
PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue));
@@ -76,18 +76,18 @@ void opt_error_set(SEXP env) {
7676
PROTECT(wy = findVarInFrame(env, install("wy"))); pc++;
7777
PROTECT(WX = findVarInFrame(env, install("WX"))); pc++;
7878

79-
pt->y = Calloc(n, double);
80-
pt->x = Calloc(np, double);
81-
pt->yl = Calloc(n, double);
82-
pt->wy1 = Calloc(n, double);
83-
pt->xlq = Calloc(np, double);
84-
pt->wx1 = Calloc(np, double);
85-
pt->qy = Calloc(np, double);
86-
pt->xlqyl = Calloc(p, double);
87-
pt->jpvt = Calloc(p, int);
88-
pt->work = Calloc(p*2, double);
89-
/* pt->work = Calloc(p, double); */
90-
pt->qraux = Calloc(p, double);
79+
pt->y = R_Calloc(n, double);
80+
pt->x = R_Calloc(np, double);
81+
pt->yl = R_Calloc(n, double);
82+
pt->wy1 = R_Calloc(n, double);
83+
pt->xlq = R_Calloc(np, double);
84+
pt->wx1 = R_Calloc(np, double);
85+
pt->qy = R_Calloc(np, double);
86+
pt->xlqyl = R_Calloc(p, double);
87+
pt->jpvt = R_Calloc(p, int);
88+
pt->work = R_Calloc(p*2, double);
89+
/* pt->work = R_Calloc(p, double); */
90+
pt->qraux = R_Calloc(p, double);
9191

9292
for (i=0; i<n; i++) {
9393
pt->y[i] = NUMERIC_POINTER(y)[i];
@@ -110,19 +110,19 @@ SEXP opt_error_free(SEXP ptr) {
110110

111111
pt = (OPT_ERROR_SSE *) R_ExternalPtrAddr(ptr);
112112

113-
Free(pt->qraux);
114-
Free(pt->work);
115-
Free(pt->jpvt);
116-
Free(pt->xlqyl);
117-
Free(pt->qy);
118-
Free(pt->wx1);
119-
Free(pt->xlq);
120-
Free(pt->wy1);
121-
Free(pt->yl);
122-
Free(pt->x);
123-
Free(pt->y);
124-
125-
Free(pt);
113+
R_Free(pt->qraux);
114+
R_Free(pt->work);
115+
R_Free(pt->jpvt);
116+
R_Free(pt->xlqyl);
117+
R_Free(pt->qy);
118+
R_Free(pt->wx1);
119+
R_Free(pt->xlq);
120+
R_Free(pt->wy1);
121+
R_Free(pt->yl);
122+
R_Free(pt->x);
123+
R_Free(pt->y);
124+
125+
R_Free(pt);
126126
R_ClearExternalPtr(ptr);
127127
return(R_NilValue);
128128
}
@@ -132,7 +132,7 @@ SEXP hess_error_init(void) { /* -Wstrict-prototypes */
132132
HESS_ERROR_SSE *pt;
133133
SEXP ptr;
134134

135-
pt = Calloc(1, HESS_ERROR_SSE);
135+
pt = R_Calloc(1, HESS_ERROR_SSE);
136136
pt->set = FALSE;
137137

138138
PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue));
@@ -162,14 +162,14 @@ void hess_error_set(SEXP env) {
162162
PROTECT(wy = findVarInFrame(env, install("wy"))); pc++;
163163
PROTECT(WX = findVarInFrame(env, install("WX"))); pc++;
164164

165-
pt->y = Calloc(n, double);
166-
pt->x = Calloc(np, double);
167-
pt->yl = Calloc(n, double);
168-
pt->wy1 = Calloc(n, double);
169-
pt->xl = Calloc(np, double);
170-
pt->wx1 = Calloc(np, double);
171-
pt->beta1 = Calloc(p, double);
172-
pt->xlb = Calloc(n, double);
165+
pt->y = R_Calloc(n, double);
166+
pt->x = R_Calloc(np, double);
167+
pt->yl = R_Calloc(n, double);
168+
pt->wy1 = R_Calloc(n, double);
169+
pt->xl = R_Calloc(np, double);
170+
pt->wx1 = R_Calloc(np, double);
171+
pt->beta1 = R_Calloc(p, double);
172+
pt->xlb = R_Calloc(n, double);
173173

174174
for (i=0; i<n; i++) {
175175
pt->y[i] = NUMERIC_POINTER(y)[i];
@@ -192,16 +192,16 @@ SEXP hess_error_free(SEXP ptr) {
192192

193193
pt = (HESS_ERROR_SSE *) R_ExternalPtrAddr(ptr);
194194

195-
Free(pt->xlb);
196-
Free(pt->beta1);
197-
Free(pt->wx1);
198-
Free(pt->xl);
199-
Free(pt->wy1);
200-
Free(pt->yl);
201-
Free(pt->x);
202-
Free(pt->y);
195+
R_Free(pt->xlb);
196+
R_Free(pt->beta1);
197+
R_Free(pt->wx1);
198+
R_Free(pt->xl);
199+
R_Free(pt->wy1);
200+
R_Free(pt->yl);
201+
R_Free(pt->x);
202+
R_Free(pt->y);
203203

204-
Free(pt);
204+
R_Free(pt);
205205
R_ClearExternalPtr(ptr);
206206
return(R_NilValue);
207207
}
@@ -211,7 +211,7 @@ SEXP hess_lag_init(void) { /* -Wstrict-prototypes */
211211
HESS_LAG_SSE *pt;
212212
SEXP ptr;
213213

214-
pt = Calloc(1, HESS_LAG_SSE);
214+
pt = R_Calloc(1, HESS_LAG_SSE);
215215
pt->set = FALSE;
216216

217217
PROTECT(ptr = R_MakeExternalPtr(pt, R_NilValue, R_NilValue));
@@ -240,12 +240,12 @@ void hess_lag_set(SEXP env) {
240240
PROTECT(x = findVarInFrame(env, install("x"))); pc++;
241241
PROTECT(wy = findVarInFrame(env, install("wy"))); pc++;
242242

243-
pt->y = Calloc(n, double);
244-
pt->x = Calloc(np, double);
245-
pt->yl = Calloc(n, double);
246-
pt->wy1 = Calloc(n, double);
247-
pt->beta1 = Calloc(p, double);
248-
pt->xb = Calloc(n, double);
243+
pt->y = R_Calloc(n, double);
244+
pt->x = R_Calloc(np, double);
245+
pt->yl = R_Calloc(n, double);
246+
pt->wy1 = R_Calloc(n, double);
247+
pt->beta1 = R_Calloc(p, double);
248+
pt->xb = R_Calloc(n, double);
249249

250250
for (i=0; i<n; i++) {
251251
pt->y[i] = NUMERIC_POINTER(y)[i];
@@ -265,14 +265,14 @@ SEXP hess_lag_free(SEXP ptr) {
265265

266266
pt = (HESS_LAG_SSE *) R_ExternalPtrAddr(ptr);
267267

268-
Free(pt->xb);
269-
Free(pt->beta1);
270-
Free(pt->wy1);
271-
Free(pt->yl);
272-
Free(pt->x);
273-
Free(pt->y);
268+
R_Free(pt->xb);
269+
R_Free(pt->beta1);
270+
R_Free(pt->wy1);
271+
R_Free(pt->yl);
272+
R_Free(pt->x);
273+
R_Free(pt->y);
274274

275-
Free(pt);
275+
R_Free(pt);
276276
R_ClearExternalPtr(ptr);
277277
return(R_NilValue);
278278
}

0 commit comments

Comments
 (0)