scale_raster: Scales a 'Raster*' by a power of a given integer and rounds...

Description Usage Arguments Details Value See Also

Description

Useful for scaling and (optionally) rounding a RasterLayer to integer so that a layer can be saved as an integer datatype such as "INT1U", "INT1S", "INT2" or "INT2S".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
scale_raster(x, power_of = 10, max_out = 32767, round_output = TRUE,
  do_scaling = TRUE)

## S4 method for signature 'RasterLayer'
scale_raster(x, power_of = 10, max_out = 32767,
  round_output = TRUE, do_scaling = TRUE)

## S4 method for signature 'RasterStack'
scale_raster(x, power_of = 10, max_out = 32767,
  round_output = TRUE, do_scaling = TRUE)

## S4 method for signature 'RasterBrick'
scale_raster(x, power_of = 10, max_out = 32767,
  round_output = TRUE, do_scaling = TRUE)

Arguments

x

a Raster* object

power_of

raster will be scaled using the highest possible power of this number

max_out

the scaling factors will be chosen for each layer to ensure that the maximum and minimum (if minimum is negative) values of each layer do not exceed max_out

round_output

whether to round the output to the nearest integer

do_scaling

perform the scaling and return a Raster* (if do_scaling is TRUE) or return a list of scale factors (if do_scaling is FALSE)

Details

This function will run in parallel if a parallel backend is registered with foreach.

Value

a Raster* if do_scaling is TRUE, or a list of scaling factors if do_scaling is false.

See Also

dataType


azvoleff/teamlucc documentation built on June 4, 2017, 12:08 a.m.