Title: | Ordinary Kriging |
---|---|
Description: | An implementation of a simple and highly optimized ordinary kriging algorithm to plot geographical data. |
Authors: | Omar E. Olmedo |
Maintainer: | Omar E. Olmedo <[email protected]> |
License: | GPL-2 |
Version: | 1.2 |
Built: | 2025-03-08 04:45:47 UTC |
Source: | https://github.com/cran/kriging |
Create maps using the coordinates and predicted values in objects of class kriging
.
## S3 method for class 'kriging' image(x, main = NULL, xlab = "", ylab = "", col = heat.colors(100), ...)
## S3 method for class 'kriging' image(x, main = NULL, xlab = "", ylab = "", col = heat.colors(100), ...)
x |
object of class |
main |
See par. |
xlab |
See par. |
ylab |
See par. |
col |
See par. |
... |
arguments, passed to image.default. |
Omar E. Olmedo
Simple and highly optimized ordinary kriging algorithm to plot geographical data
kriging(x, y, response, model = "spherical", lags = 10, pixels = 100, polygons = NULL)
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
# 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))
# 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))
Plots distance versus semivariance with a fitted curve indicating the model used.
## S3 method for class 'kriging' plot(x, main = "Semivariogram", xlab = "Distance", ylab = "Semivariance", ...)
## S3 method for class 'kriging' plot(x, main = "Semivariogram", xlab = "Distance", ylab = "Semivariance", ...)
x |
object of class |
main |
See par. |
xlab |
See par. |
ylab |
See par. |
... |
arguments, passed to plot.default. |
Omar E. Olmedo