Interpolation: A function to do bi-directionnal linear interpolation over x...

Description Usage Arguments Value Note Author(s) Examples

Description

Interpolation takes a three columns data frame to do a linear interpolation over X with points seperated by intervX then over Y with points seperated by intervY.

Usage

1
Interpolation(Tab, intervX = NULL, intervY = NULL)

Arguments

Tab

Dataframe to be interpolated. This data frame must be a three columns data frame. Columns must be x, y and z, in that order.

intervX

Interval between two interpolated points over X axis.

intervY

Interval between two interpolated points over Y axis.

Value

Returns a three data frame of the form x, y and z with the same column names as input data frame.

Note

For further details on the use of interp, please refer to help(interp).

Author(s)

Vincent Le Bourlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# an example using the data volcano

require(lattice)
# Load volcano
data(volcano)

# Transform the data to be plotted with lattice function levelplot
x=1:dim(volcano)[1]
y=1:dim(volcano)[2]

data=expand.grid(x,y)
vol=cbind(data,c(volcano))
colnames(vol)=c("x","y","z")

# Plot the volcano with function levelpot
STdiag(z~x*y,vol,log=FALSE,col="terrain")

# Interpolate with finner X and Y and plot the new volcano 
Interpvol=Interpolation(vol,intervX=0.5,intervY=0.2)
STdiag(z~x*y,Interpvol,log=FALSE,col="terrain")

StructureTimeDiagram documentation built on May 2, 2019, 4:31 p.m.