getWeights: Calculate weights from latitude

View source: R/getWeights.R

getWeightsR Documentation

Calculate weights from latitude

Description

Calculate weights using the cosine of latitude to compensate for area distortion of non-projected lat/lon data

Usage

getWeights(x, f = function(x) cos(x), ...)

Arguments

x

a Raster* object

f

a function to be used to the weighting. Defaults to cos(x)

...

additional arguments to be passed to f

Value

a numeric vector of weights

Examples

data("australiaGPCP")
wghts <- getWeights(australiaGPCP)
wghts_rst <- australiaGPCP[[1]]
wghts_rst[] <- wghts

opar <- par(mfrow = c(1,2))
plot(australiaGPCP[[1]], main = "data")
plot(wghts_rst, main = "weights")
par(opar)


environmentalinformatics-marburg/remote documentation built on July 5, 2023, 4:36 p.m.