[R-sig-Geo] spplot help, please

Marvin Sharma marvinsharma at yahoo.com
Sat Oct 21 03:29:11 CEST 2017


Hi,I wanted to plot the spplot of my model residuals. The plot works fine, but the state map does not appear. Code is given below and the data are attached. I would greatly appreciate any help in this.
Marvin

library(spgwr)library(spdep)library(maps)library(maptools)data<-read.csv("try.csv",header=TRUE)coords=cbind(data$Longitude,data$Latitude)g.adapt.gauss <- gwr.sel(y~x, data,coords,adapt=TRUE)res.adpt <- gwr(y~x, data,coords, adapt=g.adapt.gauss)brks <- c(-0.25, 0, 0.01, 0.025, 0.075)cols <- grey(5:2/6)res.adpt$SDF$ols.e <- residuals(lm(y~x, data))spplot(res.adpt$SDF, c("ols.e","gwr.e"),main="Residuals")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20171021/39cd3667/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: try.csv
Type: application/vnd.ms-excel
Size: 8724 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20171021/39cd3667/attachment.xlb>


More information about the R-sig-Geo mailing list