Skip to content

Extract part(s) of SpatialPolygonsDataFrame

3 messages · sylvain willart, Carson Farmer

#
Hello,

I have an .RData file which is a SpatialPolygonsDataFrame a France,

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", ]

but it didn't work out,
(NAME_1 is the variable where are stored the names of the French Regions)

any idea ?

Sylvain
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 ?
#
Hi,
try:
see:
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.
Regards,

Carson
#
Great,
I didn't know about the use of '@'
Thank you

Sylvain

2010/5/13 Carson Farmer <carson.farmer at gmail.com>: