View source: R/WeightedCells.R
WeightedCells | R Documentation |
This function performs square-root of the cosine of the latitude weighting on the given array.
WeightedCells(data, lat, lat_dim = "lat", method = "cos", ncores = NULL)
data |
A numeric array with named dimensions, representing the data to be applied the weights. It should have at least the latitude dimension and it can have more other dimensions. |
lat |
A numeric vector or array with one dimension containing the latitudes (in degrees). |
lat_dim |
A character string indicating the name of the latitudinal dimension. The default value is 'lat'. |
method |
A character string indicating the type of weighting applied: 'cos' (cosine of the latitude) or 'sqrtcos' (square-root of the cosine of the latitude). The default value is 'cos'. |
ncores |
An integer indicating the number of cores to use for parallel computation. The default value is NULL. |
An array containing the latitude weighted data with same dimensions as parameter 'data'.
exp <- array(rnorm(1:30), dim = c(lat = 3, lon = 5, sdate = 2))
lat <- c(10, 15, 20)
res <- WeightedCells(data = exp, lat = lat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.