idwpred | R Documentation |
This function is to make spatial predictions using inverse distance weighting.
idwpred(longlat, trainy, longlat2, nmax = 12, idp = 2, ...)
longlat |
a dataframe contains longitude and latitude of point samples. |
trainy |
a vector of response, must have length equal to the number of rows in longlat. |
longlat2 |
a dataframe contains longitude and latitude of point locations (i.e., the centres of grids) to be predicted. |
nmax |
for a local predicting: the number of nearest observations that should be used for a prediction or simulation, where nearest is defined in terms of the space of the spatial locations. By default, 12 observations are used. |
idp |
numeric; specify the inverse distance weighting power. |
... |
other arguments passed on to gstat. |
A dataframe of longitude, latitude and predictions.
This function is largely based on library(gstat).
Jin Li
Pebesma, E.J., 2004. Multivariable geostatistics in S: the gstat package. Computers & Geosciences, 30: 683-691.
## Not run: library(sp) data(swmud) data(sw) idwpred1 <- idwpred(swmud[, c(1,2)], swmud[, 3], sw, nmax = 12, idp = 2) names(idwpred1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.