points2grid_vector: Points were to converted grids using a local gridding method.

View source: R/adw.R

points2grid_vectorR Documentation

Points were to converted grids using a local gridding method.

Description

The irregularly-spaced data of points are converted onto regular latitude-longitude grids by averaging all stations in grid-boxes.

Usage

points2grid_vector(dd, extent, gridsize = 5)

Arguments

dd

a input dataframe which contains the column names of lon, lat, value.

extent

a extent numeric vector (latitude and longitude) of length 4 in the order c(xmin, xmax, ymin, ymax).

gridsize

the grid size, i.e. the grid resolution. units: degree.

Value

a regular latitude-longitude dataframe grid (grid values).

References

Jones, P. D., and M. Hulme, 1996: Calculating regional climatic time series for temperature and precipitation: Methods and illustrations. Int. J. Climatol., 16, 361–377, https://doi.org/10.1002/(SICI)1097-0088(199604)16:4<361::AID-JOC53>3.0.CO;2-F.

Examples

set.seed(2)
dd <- data.frame(lon = runif(100, min = 110, max = 117),
                 lat = runif(100, min = 31, max = 37),
                 value = runif(100, min = -10, max = 10))
head(dd)
# example
grd <- points2grid(dd, extent = c(110, 117, 31, 37), gridsize = 0.5)
head(grd)

PanfengZhang/adw documentation built on April 18, 2024, 7:50 a.m.