Skip to content

Commit

Permalink
address #157
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Jun 8, 2024
1 parent 591c1e6 commit 88032b5
Show file tree
Hide file tree
Showing 61 changed files with 63 additions and 61 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spdep
Version: 1.3-5
Date: 2024-06-02
Date: 2024-06-08
Title: Spatial Dependence: Weighting Schemes, Statistics
Encoding: UTF-8
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"),
Expand Down Expand Up @@ -38,7 +38,7 @@ Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"),
person("René", "Westerholt", role="ctb"),
person("Levi", "Wolf", role = "ctb"),
person("Danlin", "Yu", role = "ctb"))
Depends: R (>= 3.3.0), methods, spData (>= 0.2.6.0), sf
Depends: R (>= 3.3.0), methods, spData (>= 2.3.2), sf
Imports: stats, deldir, boot (>= 1.3-1), graphics, utils, grDevices, units, s2, e1071, sp (>= 1.0)
Suggests: spatialreg (>= 1.2-1), Matrix, parallel, dbscan, RColorBrewer, lattice, xtable, foreign, igraph, RSpectra, knitr, classInt, tmap, spam, ggplot2, rmarkdown, tinytest, rgeoda
URL: https://github.com/r-spatial/spdep/, https://r-spatial.github.io/spdep/
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Version 1.3-4 (development)
# Version 1.3-5 (development)

* #157 migrate ESRI Shapefile to GPKG files; convert bhicv.shp to GPKG

* #155 Throw error if `hotspot` despatched on object without a `"quadr"` attribute

Expand Down
Binary file removed inst/etc/shapes/bhicv.dbf
Binary file not shown.
Binary file added inst/etc/shapes/bhicv.gpkg
Binary file not shown.
Binary file removed inst/etc/shapes/bhicv.shp
Binary file not shown.
Binary file removed inst/etc/shapes/bhicv.shx
Binary file not shown.
Binary file removed inst/etc/shapes/columbus.dbf
Binary file not shown.
Binary file removed inst/etc/shapes/columbus.shp
Binary file not shown.
Binary file removed inst/etc/shapes/columbus.shx
Binary file not shown.
Binary file removed inst/etc/shapes/eire.dbf
Binary file not shown.
Binary file removed inst/etc/shapes/eire.shp
Binary file not shown.
Binary file removed inst/etc/shapes/eire.shx
Binary file not shown.
2 changes: 1 addition & 1 deletion man/EBImoran.mc.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ following components:
\seealso{\code{\link{moran}}, \code{\link{moran.mc}}, \code{\link{EBest}}}

\examples{
nc.sids <- st_read(system.file("shapes/sids.shp", package="spData")[1], quiet=TRUE)
nc.sids <- st_read(system.file("shapes/sids.gpkg", package="spData")[1], quiet=TRUE)
rn <- as.character(nc.sids$FIPS)
ncCC89_nb <- read.gal(system.file("weights/ncCC89.gal", package="spData")[1],
region.id=rn)
Expand Down
2 changes: 1 addition & 1 deletion man/EBest.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ and a \code{parameters} attribute list with components:
\seealso{\code{\link{EBlocal}}, \code{\link{probmap}}, \code{\link{EBImoran.mc}}}

\examples{
auckland <- st_read(system.file("shapes/auckland.shp", package="spData")[1], quiet=TRUE)
auckland <- st_read(system.file("shapes/auckland.gpkg", package="spData")[1], quiet=TRUE)
res <- EBest(auckland$M77_85, 9*auckland$Und5_81)
attr(res, "parameters")
auckland$estmm000 <- res$estmm*1000
Expand Down
2 changes: 1 addition & 1 deletion man/EBlocal.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ and a \code{parameters} attribute list with components (if both are zero, the es
\seealso{\code{\link{EBest}}, \code{\link{probmap}}}

\examples{
auckland <- st_read(system.file("shapes/auckland.shp", package="spData")[1], quiet=TRUE)
auckland <- st_read(system.file("shapes/auckland.gpkg", package="spData")[1], quiet=TRUE)
auckland.nb <- poly2nb(auckland)
res <- EBlocal(auckland$M77_85, 9*auckland$Und5_81, auckland.nb)
auckland$est000 <- res$est*1000
Expand Down
2 changes: 1 addition & 1 deletion man/SD.RStests.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The results in the example below agree with those in Table 3, p. 22 in Koley and
\code{\link{lm}}, \code{\link{lm.RStests}}
}
\examples{
columbus <- sf::st_read(system.file("shapes/columbus.shp", package="spData")[1])
columbus <- sf::st_read(system.file("shapes/columbus.gpkg", package="spData")[1])
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
col.listw <- nb2listw(col.gal.nb, style="W")
lm_obj <- lm(CRIME ~ INC + HOVAL, data=columbus)
Expand Down
2 changes: 1 addition & 1 deletion man/autocov_dist.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for details.}

\seealso{\code{\link{nb2listw}}}
\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
#xy <- cbind(columbus$X, columbus$Y)
xy <- st_coordinates(st_centroid(st_geometry(columbus),
of_largest_polygon=TRUE))
Expand Down
2 changes: 1 addition & 1 deletion man/bhicv.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
%%\format{}
%%\details{}
\examples{
bh <- st_read(system.file("etc/shapes/bhicv.shp",
bh <- st_read(system.file("etc/shapes/bhicv.gpkg",
package="spdep")[1])
}
\keyword{data}% at least one, from doc/KEYWORDS
2 changes: 1 addition & 1 deletion man/choynowski.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Interactive Spatial Data Analysis, Harlow: Longman, pp. 300--303.}

\seealso{\code{\link{probmap}}}
\examples{
auckland <- st_read(system.file("shapes/auckland.shp", package="spData")[1], quiet=TRUE)
auckland <- st_read(system.file("shapes/auckland.gpkg", package="spData")[1], quiet=TRUE)
auckland.nb <- poly2nb(auckland)
res <- choynowski(auckland$M77_85, 9*auckland$Und5_81)
resl <- choynowski(auckland$M77_85, 9*auckland$Und5_81, legacy=TRUE)
Expand Down
2 changes: 1 addition & 1 deletion man/columbus.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
The data set is now part of the spData package
}
\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
}

Expand Down
2 changes: 1 addition & 1 deletion man/compon.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A list of:
\author{Nicholas Lewin-Koh \email{nikko@hailmail.net}}
\seealso{\code{\link{plot.nb}}}
\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(st_geometry(columbus)))
plot(col.gal.nb, coords, col="grey")
Expand Down
2 changes: 1 addition & 1 deletion man/diffnb.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A neighbours list with class \code{nb}
\author{Roger Bivand \email{Roger.Bivand@nhh.no}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
coords <- st_centroid(st_geometry(columbus), of_largest_polygon=TRUE)
rn <- row.names(columbus)
knn1 <- knearneigh(coords, 1)
Expand Down
2 changes: 1 addition & 1 deletion man/dnearneigh.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for neighbours satisfying the distance criteria. See \code{\link{card}} for deta
\seealso{\code{\link{knearneigh}}, \code{\link{card}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
coords <- st_centroid(st_geometry(columbus), of_largest_polygon=TRUE)
rn <- row.names(columbus)
k1 <- knn2nb(knearneigh(coords))
Expand Down
2 changes: 1 addition & 1 deletion man/edit.nb.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The function returns an object of class \code{nb} with the edited list of intege

\examples{
\dontrun{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
class(columbus)
if (FALSE) nnb1 <- edit.nb(col.gal.nb, polys=as(columbus, "Spatial"))
}
Expand Down
2 changes: 1 addition & 1 deletion man/globalG.test.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ p. 276; Bivand RS, Wong DWS 2018 Comparing implementations of global and local i
\seealso{\code{\link{localG}}}

\examples{
nc.sids <- st_read(system.file("shapes/sids.shp", package="spData")[1], quiet=TRUE)
nc.sids <- st_read(system.file("shapes/sids.gpkg", package="spData")[1], quiet=TRUE)
sidsrate79 <- (1000*nc.sids$SID79)/nc.sids$BIR79
dists <- c(10, 20, 30, 33, 40, 50, 60, 70, 80, 90, 100)
ndists <- length(dists)
Expand Down
2 changes: 1 addition & 1 deletion man/graphneigh.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The helper functions return an \code{nb} object with a list of integer
\code{\link{knn2nb}}, \code{\link{card}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
sf_obj <- st_centroid(st_geometry(columbus), of_largest_polygon)
sp_obj <- as(sf_obj, "Spatial")
coords <- st_coordinates(sf_obj)
Expand Down
2 changes: 1 addition & 1 deletion man/include.self.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The function returns an object of class \code{nb} with a list of integer vectors
\seealso{\code{\link{summary.nb}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(columbus))
summary(col.gal.nb, coords)
Expand Down
2 changes: 1 addition & 1 deletion man/joincount.multi.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A matrix with class \code{jcmulti} with row and column names for observed and ex
\seealso{\code{\link{joincount.test}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
HICRIME <- cut(columbus$CRIME, breaks=c(0,35,80), labels=c("low","high"))
(nb <- poly2nb(columbus))
lw <- nb2listw(nb, style="B")
Expand Down
2 changes: 1 addition & 1 deletion man/joincount.test.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ print(is.symmetric.nb(COL.k4.nb))
joincount.test(HICRIME, nb2listw(COL.k4.nb, style="B"))
cat("Note non-symmetric weights matrix - use listw2U()\n")
joincount.test(HICRIME, listw2U(nb2listw(COL.k4.nb, style="B")))
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
HICRIME <- cut(columbus$CRIME, breaks=c(0,35,80), labels=c("low","high"))
(nb <- poly2nb(columbus))
lw <- nb2listw(nb, style="B")
Expand Down
2 changes: 1 addition & 1 deletion man/knearneigh.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A list of class \code{knn}
\code{\link{knn2nb}}, \code{\link[dbscan]{kNN}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
coords <- st_centroid(st_geometry(columbus), of_largest_polygon=TRUE)
col.knn <- knearneigh(coords, k=4)
plot(st_geometry(columbus), border="grey")
Expand Down
2 changes: 1 addition & 1 deletion man/knn2nb.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The function returns an object of class \code{nb} with a list of integer vectors
\seealso{\code{\link{knearneigh}}, \code{\link{card}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
coords <- st_coordinates(st_centroid(columbus))
col.knn <- knearneigh(coords, k=4)
plot(st_geometry(columbus), border="grey")
Expand Down
2 changes: 1 addition & 1 deletion man/listw2sn.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sn2listw(sn, style = NULL, zero.policy = NULL, from_mat2listw=FALSE)
\seealso{\code{\link{nb2listw}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
col.listw <- nb2listw(col.gal.nb)
col.listw$neighbours[[1]]
Expand Down
2 changes: 1 addition & 1 deletion man/lm.morantest.exact.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ must be one of greater (default), less or two.sided.}
\seealso{\code{\link{lm.morantest.sad}}}
\examples{
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
Expand Down
2 changes: 1 addition & 1 deletion man/lm.morantest.sad.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Geographical Analysis, 34, pp. 187--206; Bivand RS, Wong DWS 2018 Comparing impl
\seealso{\code{\link{lm.morantest}}}

\examples{
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
Expand Down
2 changes: 1 addition & 1 deletion man/localGS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Sonea, A. and Westerholt, R. (2021): Geographic and temporal access to basic ban

\examples{
\donttest{
boston.tr <- sf::st_read(system.file("shapes/boston_tracts.shp", package="spData")[1])
boston.tr <- sf::st_read(system.file("shapes/boston_tracts.gpkg", package="spData")[1])
boston.tr_utm <- st_transform(boston.tr, 32619) #26786

boston_listw1 <- nb2listwdist(dnearneigh(st_centroid(boston.tr_utm), 1, 2000),
Expand Down
2 changes: 1 addition & 1 deletion man/localmoran.exact.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ When the alternative is being tested, a list of left and right M products in att
\seealso{\code{\link{lm.morantest.exact}}, \code{\link{localmoran.sad}}}
\examples{
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
Expand Down
2 changes: 1 addition & 1 deletion man/localmoran.sad.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Geographical Analysis, 34, pp. 187--206.}
\code{\link{lm.morantest.sad}}, \code{\link{errorsarlm}}}

\examples{
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
Expand Down
2 changes: 1 addition & 1 deletion man/localmoran_bv.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ I_i^B= cx_i\Sigma_j{w_{ij}y_j}
}
\examples{
# load columbus data
columbus <- st_read(system.file("shapes/columbus.shp", package="spData"))
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData"))
nb <- poly2nb(columbus)
listw <- nb2listw(nb)
set.seed(1)
Expand Down
2 changes: 1 addition & 1 deletion man/mat2listw.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A \code{listw} object with the following members:

\seealso{\code{\link{nb2listw}}, \code{\link{nb2mat}}}
\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col005 <- dnearneigh(st_coordinates(st_centroid(st_geometry(columbus),
of_largest_polygon=TRUE)), 0, 0.5, as.character(columbus$NEIGNO))
summary(col005)
Expand Down
2 changes: 1 addition & 1 deletion man/moran.test.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ moran.test(crime, nb2listw(COL.nb, style="W"), zero.policy=TRUE,
moran.test(crime, nb2listw(COL.nb, style="W"), zero.policy=TRUE,
na.action=na.exclude)
moran.test(crime, nb2listw(COL.nb, style="W"), na.action=na.pass)
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col_geoms <- st_geometry(columbus)
col_geoms[1] <- st_buffer(col_geoms[1], dist=-0.05)
st_geometry(columbus) <- col_geoms
Expand Down
2 changes: 1 addition & 1 deletion man/mstree.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mstree(nbw, ini = NULL)
%%\seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ }
\examples{
### loading data
bh <- st_read(system.file("etc/shapes/bhicv.shp",
bh <- st_read(system.file("etc/shapes/bhicv.gpkg",
package="spdep")[1], quiet=TRUE)
st_crs(bh) <- "OGC:CRS84"
### data padronized
Expand Down
2 changes: 1 addition & 1 deletion man/nb2lines.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ df2sn(df, i="i", i_ID="i_ID", j="j", wt="wt")
\seealso{\code{\link{sn2listw}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
res <- listw2lines(nb2listw(col.gal.nb), st_geometry(columbus))
summary(res)
Expand Down
2 changes: 1 addition & 1 deletion man/nb2listw.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ and attributes:
\seealso{\code{\link{summary.nb}}, \code{\link{read.gal}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(columbus))
cards <- card(col.gal.nb)
Expand Down
2 changes: 1 addition & 1 deletion man/nb2mat.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ An n by n matrix, where n=length(neighbours)
\seealso{\code{\link{nb2listw}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col005 <- dnearneigh(st_coordinates(st_centroid(st_geometry(columbus),
of_largest_polygon=TRUE)), 0, 0.5, as.character(columbus$NEIGNO))
summary(col005)
Expand Down
2 changes: 1 addition & 1 deletion man/nbdists.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A list with class \code{nbdist}
\seealso{\code{\link{summary.nb}}, \code{\link{nb2listw}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(columbus))
dlist <- nbdists(col.gal.nb, coords)
Expand Down
2 changes: 1 addition & 1 deletion man/nblag.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ returns a list of lagged neighbours lists each with class \code{nb}
\seealso{\code{\link{summary.nb}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(columbus))
summary(col.gal.nb, coords)
Expand Down
2 changes: 1 addition & 1 deletion man/nboperations.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ complement.nb(nb.obj)
\code{\link{setdiff.nb}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(columbus))
col.tri.nb <- tri2nb(coords)
Expand Down
2 changes: 1 addition & 1 deletion man/plot.nb.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ neighbours lists}
\seealso{\code{\link{summary.nb}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
plot(col.gal.nb, st_geometry(columbus))
title(main="GAL order 1 links with first nearest neighbours in red", cex.main=0.6)
Expand Down
4 changes: 2 additions & 2 deletions man/poly2nb.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ From 1.1-9 with \pkg{sf} 1.0-0, \pkg{s2} is used in bounding box indexing intern
\seealso{\code{\link{summary.nb}}, \code{\link{card}}}

\examples{
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_coordinates(st_centroid(st_geometry(columbus)))
xx <- poly2nb(as(columbus, "Spatial"))
Expand Down Expand Up @@ -62,7 +62,7 @@ fg[maxconts] <- "red"
fg[xx[[maxconts]]] <- "green"
plot(st_geometry(columbus), col=fg)
title(main="Region with largest number of contiguities", cex.main=0.6)
nc.sids <- st_read(system.file("shapes/sids.shp", package="spData")[1], quiet=TRUE)
nc.sids <- st_read(system.file("shapes/sids.gpkg", package="spData")[1], quiet=TRUE)
system.time(xxnb <- poly2nb(nc.sids))
system.time(xxnb <- poly2nb(as(nc.sids, "Spatial")))
plot(st_geometry(nc.sids))
Expand Down
2 changes: 1 addition & 1 deletion man/probmap.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ probmap(n, x, row.names=NULL, alternative="less")
\seealso{\code{\link{EBest}}, \code{\link{EBlocal}}, \code{\link{ppois}}}

\examples{
auckland <- st_read(system.file("shapes/auckland.shp", package="spData")[1], quiet=TRUE)
auckland <- st_read(system.file("shapes/auckland.gpkg", package="spData")[1], quiet=TRUE)
res <- probmap(auckland$M77_85, 9*auckland$Und5_81)
rt <- sum(auckland$M77_85)/sum(9*auckland$Und5_81)
ppois_pmap <- numeric(length(auckland$Und5_81))
Expand Down
2 changes: 1 addition & 1 deletion man/skater.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ skater(edges, data, ncuts, crit, vec.crit, method = c("euclidean",
\seealso{See Also as \code{\link{mstree}}}
\examples{
### loading data
bh <- st_read(system.file("etc/shapes/bhicv.shp",
bh <- st_read(system.file("etc/shapes/bhicv.gpkg",
package="spdep")[1], quiet=TRUE)
st_crs(bh) <- "OGC:CRS84"
### data standardized
Expand Down
2 changes: 1 addition & 1 deletion man/sp.correlogram.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ of the Institute of British Geographers}, 66, 95--118.}
\seealso{\code{\link{nblag}}, \code{\link{moran}}, \code{\link[stats]{p.adjust}}}

\examples{
nc.sids <- st_read(system.file("shapes/sids.shp", package="spData")[1], quiet=TRUE)
nc.sids <- st_read(system.file("shapes/sids.gpkg", package="spData")[1], quiet=TRUE)
rn <- as.character(nc.sids$FIPS)
ncCC89_nb <- read.gal(system.file("weights/ncCC89.gal", package="spData")[1],
region.id=rn)
Expand Down
Loading

0 comments on commit 88032b5

Please sign in to comment.