There are already methods for Raster* in the raster package.
Adding methods for list, SpatialPolygons, SpatialLines,
and SpatialPoints, gg, histogram, igraph.
These latter classes return 1.
numLayers(x)# S4 method for list
numLayers(x)
# S4 method for .spadesPlot
numLayers(x)
# S4 method for Raster
numLayers(x)
# S4 method for Spatial
numLayers(x)
# S4 method for ANY
numLayers(x)
A .spadesPlotObjects object or list of these.
The number of layers in the object.