is.bool.Rd
The values in a SpatRaster layer are by default numeric, but they can also be logical (Boolean), integer, or categorical (factor).
For a SpatRaster
, as.logical
and isTRUE
is equivalent to as.bool
. isFALSE
is equivalent to !as.bool
, and as.integer
is the same as as.int
.
See levels
and cats
to create categorical layers by setting labels.
# S4 method for SpatRaster
is.bool(x)
# S4 method for SpatRaster
as.bool(x, filename, ...)
# S4 method for SpatRaster
is.int(x)
# S4 method for SpatRaster
as.int(x, filename, ...)
# S4 method for SpatRaster
is.factor(x)
# S4 method for SpatRaster
as.factor(x)
SpatRaster
character. Output filename
list with named options for writing files as in writeRaster
The as.*
methods return a new SpatRaster
, whereas the is.*
methods return a logical
value for each layer in x
.