title: Simple way to subset SpatialPolygonsDataFrame (i.e. delete polygons) by attribute in R
body: <p>I would like simply delete some polygons from a SpatialPolygonsDataFrame object based on corresponding attribute values in the @data data frame so that I can plot a simplified/subsetted shapefile.  So far I haven't found a way to do this.</p>
  
  <p>For example, let's say I want to delete all polygons from this <a href="http://thematicmapping.org/downloads/TM_WORLD_BORDERS_SIMPL-0.3.zip" rel="noreferrer">world shapefile</a> that have an area of less than 30000.  How would I go about doing this?</p>
  
  <p>Or, similarly, how can I delete Antartica?</p>
  
  <pre><code>require(maptools)
  
  getinfo.shape("TM_WORLD_BORDERS_SIMPL-0.3.shp") 
  # Shapefile type: Polygon, (5), # of Shapes: 246
  world.map &lt;- readShapeSpatial("TM_WORLD_BORDERS_SIMPL-0.3.shp")
  
  class(world.map)
  # [1] "SpatialPolygonsDataFrame"
  # attr(,"package")
  # [1] "sp"
  
  head(world.map@data)
  #   FIPS ISO2 ISO3 UN                NAME   AREA  POP2005 REGION SUBREGION     LON     LAT
  # 0   AC   AG  ATG 28 Antigua and Barbuda     44    83039     19        29 -61.783  17.078
  # 1   AG   DZ  DZA 12             Algeria 238174 32854159      2        15   2.632  28.163
  # 2   AJ   AZ  AZE 31          Azerbaijan   8260  8352021    142       145  47.395  40.430
  # 3   AL   AL  ALB  8             Albania   2740  3153731    150        39  20.068  41.143
  # 4   AM   AM  ARM 51             Armenia   2820  3017661    142       145  44.563  40.534
  # 5   AO   AO  AGO 24              Angola 124670 16095214      2        17  17.544 -12.296
  </code></pre>
  
  <p>If I do something like this, the plot does not reflect any changes.</p>
  
  <pre><code>world.map@data = world.map@data[world.map@data$AREA &gt; 30000,]
  plot(world.map)
  </code></pre>
  
  <p>same result if I do this:</p>
  
  <pre><code>world.map@data = world.map@data[world.map@data$NAME != "Antarctica",]
  plot(world.map)
  </code></pre>
  
  <p>Any help is appreciated!</p>