Learn R Programming

imager (version 0.45.8)

RasterPackage: Convert a RasterLayer/RasterBrick to a cimg image/image list

Description

The raster library stores its data as "RasterLayer" and "RasterBrick" objects. The raster package can store its data out-of-RAM, so in order not to load too much data the "maxpixels" argument sets a limit on how many pixels are loaded.

Usage

# S3 method for RasterLayer
as.cimg(obj, maxpixels = 1e+07, ...)

# S3 method for RasterStackBrick as.imlist(obj, maxpixels = 1e+07, ...)

Arguments

obj

an object of class "RasterLayer"

maxpixels

max. number of pixels to load (default 1e7)

...

ignored

Author

Simon Barthelme, adapted from the image method for RasterLayer by Robert J Hijmans