parScale
expands the raster::scale
function to allow for
faster parallel processing, scaling each layer of x
in parallel.
parScale(x, ...)# S4 method for Raster
parScale(
x,
center = TRUE,
scale = TRUE,
filename = "",
progress = FALSE,
parallel = FALSE,
n = 1,
cl = NULL,
keep.open = FALSE,
...
)
Raster* object
Additional arguments for writeRaster
logical or numeric. If TRUE
, centering is done by
subtracting the layer means (omitting NAs), and if FALSE
, no centering
is done. If center
is a numeric vector with length equal to the
nlayers(x)
, then each layer of x
has the corresponding value
from center subtracted from it
logical or numeric. If TRUE
, scaling is done by dividing
the (centered) layers of x
by their standard deviations if center is
TRUE
, and the root mean square otherwise. If scale is FALSE
,
no scaling is done. If scale is a numeric vector with length equal to
nlayers(x)
, each layer of x
is divided by the corresponding
value. Scaling is done after centering
character. Optional filename to save the Raster* output to
file. If this is not provided, a temporary file will be created for large x
logical. If TRUE
, messages and progress bar will be
printed
logical. If TRUE
then multiple cores are utilized
numeric. Number of CPU cores to utilize for parallel processing
optional cluster object
logical. If TRUE
and parallel = TRUE
, the
cluster object will not be closed after the function has finished
Raster* object
# NOT RUN {
ch.scale <- parScale(x = climdat.hist)
# }
Run the code above in your browser using DataLab