is_raster: Checks whether object is a raster and returns a matrix if yes

Description Usage Arguments Value Examples

Description

is_raster is used to permit flexibility in the use of rasters, matrices or arrays in many functions.

Usage

1

Arguments

r

an R object

Value

if r is a raster, returns a matrix containing all values of r, otherwise returns r

Examples

1
2
3
4
5
r <- is_raster(dtm100m)
class(dtm100m) # is a RasterLayer
class(r) # is a matrix
plot(r) # not a raster
plot(raster(r)) # converts to raster

ilyamaclean/ecohydrotools documentation built on June 10, 2019, 5:45 a.m.