Hello all. I feel like this is a very easy thing that I have made difficult, but such is learning. I am trying to calculate the perimeter of every polygon in a shapefile, and I am running into all kinds of problems. I have looked into PBSmapping's calcLength, but I get the following error:

> data = readShapePoly("shapefile.shp")
> data.polydata = as.PolyData(data@data)
> calcLength(data.polydata)
Error in calcLength(data.polydata) : Invalid PolySet 'polys'.
Unexpected class (PolyData).

I'm running Mac OS X 10.7 and cannot seem to get rgeos or rgdal to load, which is compounding the difficulty. I was wondering if somebody might fix my code above, or point me towards a package that can do this easily. 

Thanks very much!

Sam Rabin
     Graduate student
         Princeton University
         Ecology & Evolutionary Biology
	[[alternative HTML version deleted]]

