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.
# S3 method for RasterLayer
as.cimg(obj, maxpixels = 1e+07, ...)# S3 method for RasterStackBrick
as.imlist(obj, maxpixels = 1e+07, ...)
an object of class "RasterLayer"
max. number of pixels to load (default 1e7)
ignored