kriging {kriging} | R Documentation |
Ordinary Kriging
Description
Simple and highly optimized ordinary kriging algorithm to plot geographical data
Usage
kriging(x, y, response, model = "spherical", lags = 10, pixels = 100, polygons = NULL)
Arguments
x |
vector of x-axis spatial points. |
y |
vector of y-axis spatial points. |
response |
vector of observed values. |
model |
specification of the variogram model. Choices are |
lags |
number of lags. Defaults to |
pixels |
maximum number of points along either axis. Defaults to |
polygons |
list of polygons used to grid predicted values on to. The default value of |
Details
The kriging algorithm assumes a minimum number of observations in order to fit the variogram model.
Value
An object of class kriging
that inherits from list
and is composed of:
model |
character; variogram model. |
nugget |
numeric; value of nugget parameter. |
range |
numeric; value of range parameter. |
sill |
numeric; value of sill parameter. |
map |
data.frame; contains the predicted values along with the coordinate covariates. |
semivariogram |
data.frame; contains the distance and semivariance values. |
Author(s)
Omar E. Olmedo
See Also
Examples
# Krige random data for a specified area using a list of polygons
library(maps)
usa <- map("usa", "main", plot = FALSE)
p <- list(data.frame(usa$x, usa$y))
# Create some random data
x <- runif(50, min(p[[1]][,1]), max(p[[1]][,1]))
y <- runif(50, min(p[[1]][,2]), max(p[[1]][,2]))
z <- rnorm(50)
# Krige and create the map
kriged <- kriging(x, y, z, polygons=p, pixels=300)
image(kriged, xlim = extendrange(x), ylim = extendrange(y))