Learn R Programming

raster (version 2.0-41)

scale: Scale values

Description

Center and/or scale raster data

Usage

## S3 method for class 'Raster':
scale(x, center=TRUE, scale=TRUE)

Arguments

x
Raster* object
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)
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

Value

  • Raster* object

See Also

scale

Examples

Run this code
b <- brick(system.file("external/rlogo.grd", package="raster"))
bs <- scale(b)

Run the code above in your browser using DataLab