R/is.Raster.R

Defines functions is.Raster

Documented in is.Raster

#' Tests if an input is a RasterLayer, RasterBrick, or a RasterStack.
#' 
#' @param x an R Object.
#' @return A logical vector.
#' @author Jonathan A. Greenberg
#' @examples
#' if(require(raster) && require(rgdal))
#' {
#' tahoe_highrez <- brick(system.file("external/tahoe_highrez.tif", package="gdalUtils"))
#' is.Raster(tahoe_highrez)
#' tahoe_lidar_bareearth <- 
#' 	raster(system.file("external/tahoe_lidar_bareearth.tif", package="gdalUtils"))
#' is.Raster(tahoe_lidar_bareearth)
#' is.Raster("character")
#' }
#' @import raster
#' @export

is.Raster <- function(x)
{
	return((class(x)=="RasterLayer" || class(x)=="RasterBrick" || class(x)=="RasterStack"))
}
gearslaboratory/gdalUtils documentation built on Feb. 17, 2020, 8:09 a.m.