[R-sig-Geo] spplot help, please

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sat Oct 21 10:58:55 CEST 2017



On 10/21/2017 03:29 AM, Marvin Sharma via R-sig-Geo wrote:
> 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.

I can't see where you're trying to plot/add a state map, in the example
below.

> 
> 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")
> 
> 
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081



More information about the R-sig-Geo mailing list