Description Usage Arguments Value Examples

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

1 | ```
getWeights(x, f = function(x) cos(x), ...)
``` |

`x` |
a Raster* object |

`f` |
a function to be used to the weighting.
Defaults to |

`...` |
additional arguments to be passed to f |

a numeric vector of weights

1 2 3 4 5 6 7 8 9 | ```
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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.