data(afcon)
oid <- order(afcon$id)
resI <- localmoran(spNamedVec("totcon", afcon), nb2listw(paper.nb))
print(data.frame(resI[oid,], row.names=afcon$name[oid]), digits=2)
resG <- localG(spNamedVec("totcon", afcon), nb2listw(include.self(paper.nb)))
print(data.frame(resG[oid], row.names=afcon$name[oid]), digits=2)
Run the code above in your browser using DataLab