InverseDistanceWeighting | R Documentation |
Interpolate values in n-th dimensional space.
IDW(x0, u0, x, p = 2, na.rm = FALSE)
x0 , x |
numeric matrix of coordinates. Each row is a new coordinate, and each column is a new dimension. |
u0 |
numeric or complex vector; known values corresponding to the
coordinates of |
p |
a positive number; the influence of closer points. |
na.rm |
logical. Should missing values (including |
x0
and x
must have the same number of dimensions.
a numeric or complex vector, equal in length to the number of rows of
x
.
x0 <- c(0, 1, 4, 5)
u0 <- c(1, 2, 2, 1)
x <- seq.int(-4, 9, length.out = 1001)
u <- IDW(x0, u0, x)
graphics::plot(
panel.first = graphics::grid(col = "gray69"),
x, u, type = "l", col = "blue", lwd = 2
)
graphics::points(x0, u0, pch = 16, cex = 1.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.