if (require(sf)) {
xx <- as(st_read(system.file("shapes/sids.shp", package="spData")[1]), "Spatial")
bw <- 144.4813
if (FALSE) {
bw <- ggwr.sel(SID74 ~ I(NWBIR74/BIR74) + offset(log(BIR74)), data=xx,
family=poisson(), longlat=TRUE)
}
nc <- ggwr(SID74 ~ I(NWBIR74/BIR74) + offset(log(BIR74)), data=xx,
family=poisson(), longlat=TRUE, bandwidth=bw)
nc
if (FALSE) {
nc <- ggwr(SID74 ~ I(NWBIR74/10000) + offset(log(BIR74)), data=xx,
family=poisson(), longlat=TRUE, bandwidth=bw)
nc
nc <- ggwr(SID74 ~ I(NWBIR74/10000) + offset(log(BIR74)), data=xx,
family=quasipoisson(), longlat=TRUE, bandwidth=bw)
nc
}
}
Run the code above in your browser using DataLab