I have a
SpatialPolygonsDataFrame object. Is there way to use
apply on this object rather than using a for loop to iterate features in this object?
You probably want to iterate over the polygons.
As an example, start with this grid taken from the manual page (but cut down in size):