Learn R Programming

SpaDES.core (version 1.0.9)

rasterCreate: Simple wrapper to load any Raster* object This wraps either raster::raster, raster::stack, or raster::brick, allowing a single function to be used to create a new object of the same class as a template.

Description

Simple wrapper to load any Raster* object This wraps either raster::raster, raster::stack, or raster::brick, allowing a single function to be used to create a new object of the same class as a template.

Usage

rasterCreate(x, ...)

# S3 method for default rasterCreate(x, ...)

# S3 method for RasterBrick rasterCreate(x, ...)

# S3 method for RasterLayer rasterCreate(x, ...)

# S3 method for RasterStack rasterCreate(x, ...)

# S3 method for Raster rasterCreate(x, ...)

Arguments

x

An object, notably a Raster* object. All others will simply be passed through with no effect.

...

Passed to raster::raster, raster::stack, or raster::brick

Methods (by class)

  • default: Simply passes through argument with no effect

  • RasterBrick: Uses raster::brick

  • RasterLayer: Uses raster::raster

  • RasterStack: Uses raster::stack

  • Raster: Uses raster::raster when one of the other, less commonly used Raster* classes, e.g., RasterLayerSparse

Details

A new (empty) object of same class as the original.