Skip to content

using gwr

7 messages · Virginia, Raphael Saldanha, Edzer Pebesma +2 more

#
I have some questions:

I got an error. I dont't know why.

Somebody to help me?

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)

# error -  Erro em spDistsN1(bbox, bbox[2, ], longlat) :
#  NA/NaN/Inf em chamada de fun??o externa (argumento 1)

sp.gauss  <- gwr((tab$PERIDOSO~tab$PERREN20),data=tab,coords=mapcents, 
bandwidth=sjc.bw, hatmatrix=TRUE)
#
It is no problem for us to read all this Brazilian (eh, sorry, 
Portugese), but it is hard to reproduce your error without having access 
to your, or similar, data.
--
Edzer
Raphael Saldanha wrote:

  
    
#
On Tue, 11 Nov 2008, Virginia wrote:

            
Your code template is not helpful. A more recent version below, which will 
probably show that your input data are in error:
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)
Please always include the output of traceback() after an error, and of
sessionInfo() to show your platform and package versions.

Roger

  
    
#
I can't read this Brazilian (Portugese :)), but it seems that the 
distance calculation is in error (possibly some coordinates were missing 
causing distance calculation yield NA/NaN/Inf value), which leads to 
distance not being able to calculated.

Like Edzer mentioned, if a sample set of your data is provided, we might 
be able to track the source.

Hope this helps.

Best,
Danlin
Edzer Pebesma wrote:

  
    
8 days later
#
On Thu, 20 Nov 2008, Virginia wrote:

            
Please use the list as described in the posting guide for all R lists:

http://www.r-project.org/posting-guide.html

You have asked a new question, but have not started a new thread, so the 
subject of your question is not connected with the question, but continues 
the thread you started 10 days ago. New questions should start a new 
thread, which means writing a fresh message, not replying to an existing 
message. Changing the subject does not help either.

Your question seems to be about point pattern analysis. Please see the 
spatial task view on CRAN - you will see that there is some information 
there that may help. When you have consulted that information, start a new 
thread if you still need help, with a clear description of your problem.

Hope this helps

Roger