[R-sig-Geo] Standard deviational ellipses (like in Crimestat)
Marco Helbich
marco.helbich at gmx.at
Fri Mar 25 12:10:51 CET 2016
Hi Roberto,
Have a look at the aspace package
(https://cran.r-project.org/web/packages/aspace/index.html). If I
remember correctly, the authors have also published a paper about the
package in Geographical Systems (or was it Geographical Analyses).
Cheers,
Marco
Am 25.03.2016 12:00, schrieb r-sig-geo-request at r-project.org:
> Send R-sig-Geo mailing list submissions to
> r-sig-geo at r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> or, via email, send a message with subject or body 'help' to
> r-sig-geo-request at r-project.org
>
> You can reach the person managing the list at
> r-sig-geo-owner at r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-Geo digest..."
>
>
> Today's Topics:
>
> 1. Problems with read.gal (Ann Hartell)
> 2. customize tick in plot(raster) (Giuseppe Amatulli)
> 3. raster package feature suggestion: give more detailed error
> output in stack() (Kenny Bell)
> 4. Standard deviational ellipses (like in Crimestat)
> (Roberto Patuelli)
> 5. Re: Problems with read.gal (Roger Bivand)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 24 Mar 2016 18:21:11 +0100
> From: Ann Hartell <ahartell at gmail.com>
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] Problems with read.gal
> Message-ID: <56F42207.3040504 at gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Hello All,
>
> I'm having issues getting R to properly read a GAL file. GeoDa is
> reading the file and correctly assigning neighbors, calculating various
> spatial statistics, etc. I've checked the GAL file for any coding
> anomolies (using a short Perl program), and all seems well.
>
> After the usual preliminaries of loading packages (e.g. spdep v.
> 0.5-92), setting a working directory, reading in the SHP file . . .
>
> ## read into R as an nb object following the Usage in the spdep help file:
>
> queen.nb <- read.gal("MyShapeFile.GAL", region.id=NULL, override.id=FALSE)
>
>
> ##Returns this error:
>
> Error in read.gal("MyShapeFile.GAL", region.id = NULL, override.id =
> FALSE) : GAL file IDs and region.id differ
>
> ##In the past, I have had success following the example
> ## from Anselin linked in the spdep help at <
> https://geodacenter.asu.edu/system/files/rex1.pdf >
>
> queen.nb <- read.gal("MyShapeFile.GAL", override.id=TRUE)
> queen.listW <- nb2listw(queen.nb, style="W", zero.policy = TRUE)
> class(queen.listW)
>
> [1] "listw" "nb"
>
> summary(queen.listW)
>
>
> Characteristics of weights list object:
> Neighbour list object:
> Number of regions: 39361
> Number of nonzero links: 238004
> Percentage nonzero weights: 0.01536215
> Average number of links: 6.046696
> Non-symmetric neighbours list
> Link number distribution:
>
> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
> 217 640 2041 4804 8062 8752 7196 4194 1863
>
>
> ###. . . . and so on . . . .
>
> ## Plotting a contiguity map reveals the trouble
>
> plot(data, border="grey60")
> title(main="Queen contiguity")
> plot(queen.listW, coord, add=TRUE, col="green", pch=19, cex=0.6)
>
> ### Far flung spatial units are linked as neighbors, which is incorrect.
> ### I get the same jumble results using:
>
> queen.nb <- read.gal("MyShapeFile.GAL", region.id = NULL, override.id=TRUE)
>
> ### Then, following the example provided here:
> http://cran.at.r-project.org/web/packages/spdep/vignettes/nb.pdf
>
> MyFile <- readShapeSpatial("MyShapeFile")
> library(spdep)
> queen.nb <- read.gal("MyShapeFile.GAL", region.id = row.names(MyFile))
>
> ## Returns:
>
> Error in read.gal("MyShapeFile.GAL", region.id = row.names(test)) : GAL
> file IDs and region.id differ
>
>
> #######End
>
> So, an issue with the id variables between the two files, but I cannot
> work out how to resolve it.
> Any insights or elaboration on the Usage and Arguments provided in the
> spdep help most appreciated.
> Thanks,
> Ann Hartell
>
More information about the R-sig-Geo
mailing list