is_raster: Is the input a raster?

Description Usage Arguments Value See Also Examples

View source: R/is-type-grDevices.R

Description

Checks to see if the input is a raster.

Usage

1
2
3
assert_is_raster(x, severity = getOption("assertive.severity", "stop"))

is_raster(x, .xname = get_name_in_parent(x))

Arguments

x

Input to check.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

.xname

Not intended to be used directly.

Value

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.

See Also

is.raster.

Examples

1
2
3
4
5
6
7
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)

assertive.types documentation built on May 1, 2019, 10:31 p.m.