kriging | R Documentation |
Simple and highly optimized ordinary kriging algorithm to plot geographical data
kriging(x, y, response, model = "spherical", lags = 10, pixels = 100, polygons = NULL)
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 |
The kriging algorithm assumes a minimum number of observations in order to fit the variogram model.
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. |
Omar E. Olmedo
image.kriging, plot.kriging.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.