Learn R Programming

maptools (version 1.1-8)

readSplus: Read exported WinBUGS maps

Description

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

Usage

readSplus(file, proj4string = CRS(as.character(NA)))

Value

readSplus returns a SpatialPolygons object

Arguments

file

name of file

proj4string

Object of class '"CRS"'; holding a valid proj4 string

Author

Virgilio Gomez Rubio <Virgilio.Gomez@uclm.es>

References

http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/geobugs12manual.pdf

See Also

map2SpatialPolygons

Examples

Run this code
if (rgeosStatus()) {
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)
}

Run the code above in your browser using DataLab