[R-sig-Geo] spplot help, please
Bede-Fazekas Ákos
bfalevlist at gmail.com
Sat Oct 21 07:53:27 CEST 2017
Hi Marvin,
this code works fine just as it should work. Which "state map" you need?
A basemap with terrain/roads/cities/borders? In this case there are
several possibilities to do that. Have a look at these links, they may
solve your problem:
https://pakillo.github.io/R-GIS-tutorial/#gmap
http://www.nickeubank.com/wp-content/uploads/2015/10/RGIS3_MakingMaps_part1_mappingVectorData.html
(Section "4.2 Basemaps with spplot")
HTH,
Ákos Bede-Fazekas
Hungarian Academy of Sciences
2017.10.21. 3:29 keltezéssel, Marvin Sharma via R-sig-Geo írta:
> 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")
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list