Description Usage Arguments Value See Also Examples
View source: R/interpolate_profile.R
The function may also be useful for other 2D interpolation purposes.
1 2 |
x |
x-coordinates (e.g. time), |
y |
y-coordinates (e.d. depth), |
z |
z-values, i.e. values that are to be interpolated. |
xo |
vector of x-coordinates of output grid. The default is 100 points evenly spaced over the range of x. |
yo |
vector of x-coordinates of output grid. The default is 100 points evenly spaced over the range of x. |
output |
determines whether the result is a grid (like in |
Either a grid (like in interp
or
a data frame with x, y, z-values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## basic usage with image
data(t_xyz)
grid <- with(t_xyz, interpolate_profile(day, depth, temp, output = "grid"))
image(grid, ylim = c(10, 0))
## 'contourplot' from lattice uses x, y, z data
xyz <- with(t_xyz, interpolate_profile(day, depth, temp, output = "xyz"))
contourplot(z ~ x * y, data = xyz,
cex.axis=1.6,
aspect = "fill",
xlab = "",
ylab = "Depth (m)",
main = "",
ylim = c(10,0),
cuts = 50,
contour = FALSE,
region = TRUE,
col.regions = rev(palette_RYB(100)),
)
## Draw 10 deg C isotherme
contourplot(z ~ x * y, data = xyz,
cex.axis=1.6,
aspect = "fill",
xlab = "",
ylab = "Depth (m)",
main = "",
ylim = c(10,0),
cuts = 50,
contour = FALSE,
region = TRUE,
col.regions = rev(palette_RYB(100)),
panel=function(x, y, z, subscripts, ...) {
panel.levelplot(x, y, z, subscripts, ...)
panel.levelplot(x, y, z, subscripts, contour = TRUE, at = 10)
}
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.