| assert_is_raster {assertive.types} | R Documentation |
Checks to see if the input is a raster.
assert_is_raster(x, severity = getOption("assertive.severity", "stop"))
is_raster(x, .xname = get_name_in_parent(x))
x |
Input to check. |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
is_raster wraps is.raster, providing more
information on failure. is_a_raster returns TRUE if the
input is raster and scalar. The assert_* functions return nothing but
throw an error if the corresponding is_* function returns
FALSE.
m <- matrix(hcl(0, 80, seq(50, 80, 10)), nrow=4, ncol=5) assert_is_raster(as.raster(m)) ## Not run: #These examples should fail. assert_is_raster(m) ## End(Not run)