| spatial_mean | R Documentation |
Spatial mean over grid points
spatial_mean(
data,
value,
by = c("year", "month"),
weight = "coslat",
lat_col = "latitude"
)
data |
Long data frame with a latitude column and the |
value |
Name of the column to average |
by |
Group columns, for example |
weight |
|
lat_col |
Name of the latitude column |
Data frame with the by columns and value. A date column is
added when by holds year and month.
grid <- expand.grid(latitude = c(10, 20), longitude = 70, year = 2000, month = 1:2)
grid$t2m <- c(20, 30, 21, 31)
spatial_mean(grid, "t2m")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.