The values in a SpatRaster layer are by default numeric, but they can also be logical (Boolean), integer, or categorical
Note that as.bool and as.int return a new SpatRaster, whereas is.bool and is.int return a logical value for each layer. For a SpatRaster, isTRUE is equivalent to as.bool, isFALSE is equivalent to !as.bool, as.integer is the same as as.int and as.logical is the same as as.bool