[R-sig-Geo] plotting only one shape from shapefile

Gasper Cankar gasper.cankar at ric.si
Mon Jan 22 07:31:30 CET 2007


Hello!

I know this must be a very simple thing to do yet after one week of trying and going through the archives I don't find the answer. I'm either looking at the wrong places or I'm cursed;)

I imported our country's shapefile with 12 regions and I can draw the shape, but I'd like to extract (and draw) only one region from whole shape.


#This is original shapefile:
slo <- read.shape(file="d://D_E_L_O/slika_slo/slo.shp")
Shapefile type: Polygon, (5), # of Shapes: 12

# and plotting (simplified)
slomap <- Map2poly(slo)
plot(slomap)

How do I plot only one of the shapes? How do I extract it as separate object?

Thank everyone in advance for any help.

Gašper




More information about the R-sig-Geo mailing list