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"))
}

Try the gdalUtils package in your browser

Any scripts or data that you put into this service are public.

gdalUtils documentation built on April 23, 2018, 9:04 a.m.