[R-sig-Geo] Extract part(s) of SpatialPolygonsDataFrame

Carson Farmer carson.farmer at gmail.com
Thu May 13 13:32:32 CEST 2010


Hi,

> I only need, for now, to work on two areas: Burgundy and Centre,
> I would like to extract those two areas from the France file,
> I tried, naïvely,
> Centre <- France[France$NAME_1=="Centre", ]

try:
> Centre <- France[France at data$NAME_1=="Centre",]

> PS: I found quite a lot of information on points, ploygons, or lines,
> but few on spatialpolygonsdataframe besides they are "a set of spatial
> polygons", Any reference on their inside structure ?

see:
> ?SpatialPolygonsDataFrame
A SpatialPolygonsDataFrame is made up of a data.frame and an object of
class SpatialPolygons, which is a list of objects of class Polygons,
which is made up of a list with Polygon class objects.
You can use getSlots to list the available slots of the various object types.
> ?getSlots

Regards,

Carson



More information about the R-sig-Geo mailing list