[R-sig-Geo] localmoran.sad() in SPDEP

Roger Bivand Roger.Bivand at nhh.no
Fri Mar 5 11:04:51 CET 2004


On Thu, 4 Mar 2004, Danlin Yu wrote:

> Dear list members:
> 
>     I was using the function localmoran.sad() in SPDEP package. Since I am
> interested in the calculation of the star shaped weight list (Vi) of each
> location, I set the save.Vi = TRUE. However, after I obtained the
> saddlepoing approximated local Moran's I object (say, locmsad), the result
> I got from using locmsad[[1]]$Vi is always "NULL". Does anybody have any
> idea what I have done wrong? Thanks in advance.

There is a bug in the code. It will be removed in the next update. For now 
edit the code in localmoran.sad() (in mtlocalmoran.R in the source 
package, line 105) or a local copy (myfun <- edit(localmoran.sad)):

is: if (save.Vi) {Vi = Vi}

should be: Vi = if(save.Vi) Vi else NULL

which returns Vi if save.Vi is TRUE. 

Roger

> 
>     Sincerely,
>     Danlin Yu, Ph.D. Candidate
>     Department of Geography
>     University of Wisconsin, Milwaukee
>     Tel: (414)229-5818
>     Fax: (414)229-3981
>     Email: danlinyu at uwm.edu
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list