Extracting polygon areas in R

Suppose I have a shapefile (lakes.shp) which consists of 5 polygons (Figure 1a). library(raster) lakes = shapefile(’lakes.shp’) plot(lakes, col=’dodgerblue’,main=’a) lakes’,lty=0) The shapefile is stored as a SpatialPolygonsDataFrame. The data underlying these polygons can be viewed …