readSplus

0th

Percentile

Read exported WinBUGS maps

The function permits an exported WinBUGS map to be read into an sp package class SpatialPolygons object.

Keywords
spatial
Usage
readSplus(file, proj4string = CRS(as.character(NA)))
Arguments
file
name of file
proj4string
Object of class '"CRS"'; holding a valid proj4 string
Value

  • readSplus returns a SpatialPolygons object

Note

In the example, taken from the GeoBUGS manual, the smaller part of area1 has a counter-clockwise ring direction in the data, while other rings are clockwise. This implies that it is a hole, and does not get filled. Errant holes may be filled using checkPolygonsHoles. The region labels are stored in the ID slots of the Polygons objects.

References

http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/geobugs12manual.pdf

See Also

map2SpatialPolygons

Aliases
  • readSplus
Examples
geobugs <- readSplus(system.file("share/Splus.map", package="maptools"))
plot(geobugs, axes=TRUE, col=1:3)
row.names(geobugs)
pls <- slot(geobugs, "polygons")
sapply(pls, function(i) sapply(slot(i, "Polygons"), slot, "hole"))
pls1 <- lapply(pls, checkPolygonsHoles)
sapply(pls1, function(i) sapply(slot(i, "Polygons"), slot, "hole"))
plot(SpatialPolygons(pls1), axes=TRUE, col=1:3)
Documentation reproduced from package maptools, version 0.8-20, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.