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.

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, ...)



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


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

Methods (by class)

  • rasterCreate(default): Simply passes through argument with no effect

  • rasterCreate(RasterBrick): Uses raster::brick

  • rasterCreate(RasterLayer): Uses raster::raster

  • rasterCreate(RasterStack): Uses raster::stack

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