interpolate_profile: Interpolate 1D Profile Data Over Time.

Description Usage Arguments Value See Also Examples

View source: R/interpolate_profile.R

Description

The function may also be useful for other 2D interpolation purposes.

Usage

1
2
interpolate_profile(x, y, z, xo = seq(min(x), max(x), length = 100), 
  yo = seq(min(y), max(y), length = 100), output = c("xyz", "grid"))

Arguments

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 interp or a data frame with x, y, z-values.

Value

Either a grid (like in interp or a data frame with x, y, z-values.

See Also

interp, expand.grid

Examples

 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)
  }
)

simecolUtil documentation built on May 2, 2019, 5:57 p.m.