Number of elements or layers in a 'VirtualArray
'-derived class object
Source: R/generics.R
, R/utility.R
, R/VirtualArray-xattrib.R
, and 2 more
arraylength.Rd
Function to return the length of the array in which elements are organized.
Usage
nlayers(x)
# S4 method for list
nlayers(x)
# S4 method for SpatRaster
nlayers(x)
# S4 method for VirtualArray
length(x)
# S4 method for XArray
nlayers(x)
# S4 method for RasterArray
nlayers(x)
Arguments
- x
a
VirtualArray
-derived class object.
Details
The length()
function returns the number elements that should be present based on the array structure itself, and not the total number of values stored in the object. As the object can contain missing values, the number of actual layers can be queried with nlayers
.