Learn R Programming

raster (version 2.3-40)

symdif: Symetrical difference

Description

Symetrical difference of SpatialPolygons* objects

Usage

## S3 method for class 'SpatialPolygons,SpatialPolygons':
symdif(x, y, ...)

Arguments

x
SpatialPolygons* object
y
SpatialPolygons* object
...
Additional SpatialPolygons* object(s)

Value

  • SpatialPolygons*

See Also

erase

Examples

Run this code
#SpatialPolygons
if (require(rgdal) & require(rgeos)) {
	p <- shapefile(system.file("external/lux.shp", package="raster"))
	b <- as(extent(6, 6.4, 49.75, 50), 'SpatialPolygons')
	projection(b) <- projection(p)
	sd <- symdif(p, b)
	plot(sd, col='red')
}

Run the code above in your browser using DataLab