apply_gains_offsets: Apply Gains and Offsets

Description Usage Arguments Author(s) See Also Examples

Description

Applies linear gains and offsets to input data following output = gains * x + offset.

Usage

1
2
  apply_gains_offsets(x, gains, offsets,
    divide_by_days_in_month = FALSE, snow_nthreads = 1)

Arguments

x

An input, such as a numeric vector (UNSUPPORTED) or a raster object.

gains

The gain to apply to the input. gain should be either a numeric vector equal to the nlayers(x) (if x is a raster) or a single value which will be applied to all layers.

offsets

The offset to apply to the input. gain should be either a numeric vector equal to the nlayers(x) (if x is a raster) or a single value which will be applied to all layers.

divide_by_days_in_month

IF x is a raster, and has a Date-coercible zvalue set, setting
divide_by_days_in_month=TRUE will divide a layer by the numbers of days in the month.

snow_nthreads

UNUSED AT PRESENT.

Author(s)

Jonathan A. Greenberg

See Also

get_climate_data

Examples

1
2
3
4
5
6
7
8
## Not run: 

#Divide all precipitation values by 10 to get cm H2O
load(system.file("extdata/pptTahoe.RData",package="climstats"))
ppt_cm=apply_gains_offsets(pptTahoe,gains=(1/10),
	divide_by_days_in_month=FALSE)

## End(Not run)

climstats documentation built on May 2, 2019, 6:15 p.m.