[R-sig-Geo] using gwr
Roger Bivand
Roger.Bivand at nhh.no
Tue Nov 11 14:58:13 CET 2008
On Tue, 11 Nov 2008, Virginia wrote:
> I have some questions:
> I got an error. I dont't know why.
> Somebody to help me?
Your code template is not helpful. A more recent version below, which will
probably show that your input data are in error:
>
> Thanks,
>
> Virginia Ragoni
>
> require(spgwr)
> require(foreign)
> x <- read.shape("cidade.shp")
> plot(x)
> mappolys <- Map2poly1(x,as.character(x$att.data$ID9100),raw=FALSE)
>
> mapbbs=Map2bbs(x)
> mapcents=get.Pcent(x)
> tab= x$att.data
>
> # cálculo da largura da banda
> sjc.bw <- gwr.sel((tab$TX_CRESC~tab$LOGDEN),data=tab,coords=mapcents)
>
library(maptools)
library(spgwr)
tab <- readShapeSpatial("cidade.shp")
# my guess is that there are non-finite centroids in the earlier version,
# certainly the distance calculation is failing
sjc.bw <- gwr.sel(TX_CRESC ~ LOGDEN, data=tab)
> # error - Erro em spDistsN1(bbox, bbox[2, ], longlat) :
> # NA/NaN/Inf em chamada de função externa (argumento 1)
>
Please always include the output of traceback() after an error, and of
sessionInfo() to show your platform and package versions.
Roger
> sp.gauss <- gwr((tab$PERIDOSO~tab$PERREN20),data=tab,coords=mapcents,
> bandwidth=sjc.bw, hatmatrix=TRUE)
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list