Dear list members

I would like to access polygons from a SpatialPolygonDataFrame in order to subset them based on the area

setwd("~/Desktop/")
require(raster) 
getData("GADM", country="ESP", level=0)-> sp_gadm
str(sp_gadm@polygons) # I can see the single polygons, but I have trouble to access them.

What I would like to do is to delete all Polygons except for the first one to have only the mainland of Spain.

Perhaps there is also an easier way - but the dataframe of the object has only one row, hence I can not subset the dataframe:
sp_gadm@data

Any help appreciated
Best regards
Ralf

------------------------------------------------------------
Prof. Dr. rer. nat. Ralf Bernhard Schäfer
Juniorprofessor for Quantitative Landscape Ecology
Environmental Scientist (M.Sc.)
Institute for Environmental Sciences
University Koblenz-Landau
Fortstrasse 7
76829 Landau
Germany
Mail: schaefer-ralf@uni-landau.de
Phone: ++49 (0) 6341 280-31536
Web: http://tinyurl.com/6dnpxna


	[[alternative HTML version deleted]]

