| regrid | R Documentation |
Each point goes into the cell of size resolution that contains it. The
result has the cell centres, so a 0.5 degree grid has centres at x.25 and
x.75, the same as CRU TS.
regrid(
data,
value,
resolution,
by = NULL,
lat_col = "latitude",
lon_col = "longitude"
)
data |
Data frame with latitude and longitude columns |
value |
Name of the column to average |
resolution |
Target cell size in degrees |
by |
Optional extra group columns, for example |
lat_col |
Name of the latitude column |
lon_col |
Name of the longitude column |
Data frame with lat_col, lon_col, the by columns and value
df <- expand.grid(latitude = seq(10, 10.75, 0.25), longitude = seq(70, 70.75, 0.25))
df$t2m <- seq_len(nrow(df))
regrid(df, "t2m", resolution = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.