parScale: Efficient scaling of Raster* objects

Description Usage Arguments Value See Also Examples

Description

parScale expands the raster::scale function to allow for faster parallel processing, scaling each layer of x in parallel.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
parScale(x, ...)

## S4 method for signature 'Raster'
parScale(
  x,
  center = TRUE,
  scale = TRUE,
  filename = "",
  progress = FALSE,
  parallel = FALSE,
  n = 1,
  cl = NULL,
  keep.open = FALSE,
  ...
)

Arguments

x

Raster* object

...

Additional arguments for writeRaster

center

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

scale

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

filename

character. Optional filename to save the Raster* output to file. If this is not provided, a temporary file will be created for large x

progress

logical. If TRUE, messages and progress bar will be printed

parallel

logical. If TRUE then multiple cores are utilized

n

numeric. Number of CPU cores to utilize for parallel processing

cl

optional cluster object

keep.open

logical. If TRUE and parallel = TRUE, the cluster object will not be closed after the function has finished

Value

Raster* object

See Also

scale, scale

Examples

1
ch.scale <- parScale(x = climdat.hist)

CENFA documentation built on Aug. 16, 2021, 9:06 a.m.