I have a list of polygons from a shapefile that I'm looping through to
assign random sampling locations to. In the loop, I wish to access the
original polygon attributes table to apply a sampling intensity that is
unique to each polygon (from a column under 'samplingintensity'). Is there
a way to apply this (e.g., n = polygon$samplingintensity) or are the
polygon attributes stripped away at this point using the slot function?

# read in polygon shapefile
strataboundaries <- readOGR('strataboundaries.shp',
layer='strataboundaries')# allocate samples to polygons
allocation <- sapply(slot(strataboundaries, 'polygons'), function(i)
spsample(i, *n=3*, type='random'))

	[[alternative HTML version deleted]]

