Skip to content

Commit

Permalink
fixes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Jun 10, 2024
1 parent 2a8b258 commit 8e36886
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatialreg
Version: 1.3-4
Date: 2024-06-08
Date: 2024-06-10
Title: Spatial Regression Analysis
Encoding: UTF-8
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "[email protected]", comment=c(ORCID="0000-0003-2392-6140")),
Expand All @@ -25,7 +25,7 @@ Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bi
person(given = "Mauricio", family = "Sarrias", role = c("ctb"), email = "[email protected]"),
person(given = "JuanTomas", family = "Sayago", role = c("ctb"), email = "[email protected]"),
person("Michael", "Tiefelsdorf", role = "ctb"))
Depends: R (>= 3.3.0), spData (>= 2.3.2), Matrix, sf
Depends: R (>= 3.3.0), spData (>= 2.3.1), Matrix, sf
Imports: spdep (>= 1.3-1), coda, methods, MASS, boot, splines, LearnBayes,
nlme, multcomp
Suggests: parallel, RSpectra, tmap, foreign, spam, knitr, lmtest, expm,
Expand Down
22 changes: 12 additions & 10 deletions vignettes/SpatialFiltering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ by Pedro Peres-Neto and is discussed in @dray+legendre+peres-neto:06 and
```{r echo=TRUE}
library(spdep)
require("sf", quietly=TRUE)
NY8 <- st_read(system.file("shapes/NY8_utm18.gpkg", package="spData"))
if (packageVersion("spData") >= "2.3.2") {
NY8 <- sf::st_read(system.file("shapes/NY8_utm18.gpkg", package="spData"))
} else {
NY8 <- sf::st_read(system.file("shapes/NY8_bna_utm18.gpkg", package="spData"))
sf::st_crs(NY8) <- "EPSG:32618"
NY8$Cases <- NY8$TRACTCAS
}
NY_nb <- read.gal(system.file("weights/NY_nb.gal", package="spData"), override.id=TRUE)
```
Expand Down Expand Up @@ -89,22 +95,18 @@ set.seed(111)
```
```{r, echo=TRUE}
nyME <- ME(Cases~PEXPOSURE+PCTAGE65P+PCTOWNHOME, data=NY8, offset=log(POP8), family="poisson", listw=NYlistwW, alpha=0.44)
nyME <- ME(Cases~PEXPOSURE+PCTAGE65P+PCTOWNHOME, data=NY8, offset=log(POP8), family="poisson", listw=NYlistwW, alpha=0.46)
```
```{r, echo=TRUE}
nyME
NY8$eigen_24 <- fitted(nyME)[,1]
NY8$eigen_223 <- fitted(nyME)[,2]
NY8$eigen_1 <- fitted(nyME)[,1]
NY8$eigen_2 <- fitted(nyME)[,2]
```
```{r, results='asis',echo=FALSE, eval=FALSE}
.iwidth <- 6
.iheight <- 4
.ipointsize <- 10
library(RColorBrewer)
```{r, echo=TRUE}
#gry <- brewer.pal(9, "Greys")[-1]
spplot(NY8, c("eigen_24", "eigen_223"), col.regions=grey.colors(6, 0.95, 0.55, 2.2), cuts=5)
plot(NY8[,c("eigen_1", "eigen_2")])
```
```{r, echo=TRUE}
Expand Down

0 comments on commit 8e36886

Please sign in to comment.