strat.plot.simple {rioja}R Documentation

Plot a simple stratigraphic diagram

Description

Plots a simple stratigraphic diagram using lattice. The function is most useful for visualising the effect of interpolating and / or smoothing a dataset.

Usage

strat.plot.simple(y1, x1, y2=NULL, x2=NULL, col=c("blue", "red"), 
     sort.vars=c("original","wa", "alphabetical"), 
     ylim=range(x1), y.rev=FALSE, type=c("b", "l"), 
     subset=c(1:ncol(y1)), ...)

Arguments

y1, y2, x1, x2 data frames to be plotted and corresponding x-values. If y2 and x2 are specified columns of y2 will be plotted overlain on those of y1.
col, type colours and line types for the plots.
sort.vars how to order variables in the plot).
ylim limits for the y-axis.
y.rev logical to reverse y-axis (which is actually the x-variable).
subset a vector of column indices or a logical vector giving a subset of columns.
... additional arguments to xyplot.

Details

strat.plot.simple plots all or a subset of variables in a data frame (y) against a single secondary variable (x). The function is appropriate for plotting stratigraphic data, with the x-variable is plotted on the y-axis and variables in y arrayed across the page. The function is primarily intended to visualise the effect of smoothing by plotting the original data with the interpolated or smoothed version superimposed.

The number of rows and columns in the plot may be controlled using the layout argument passed to link{xyplot}. For example layout=c(10,1) will produce a plot with 1 row and 10 columns.

By default, the x-axis has the same scale for all variables. To allow independent x-scales for each variable include the additional argument: scales=list(x="free")).

The function uses lattice to produce the plots so if you call it from a loop or using source you will need to wrap it in a print or plot statement.

Value

Function strat.plot.simple returns an object of class link{trellis}.

Author(s)

Steve Juggins

See Also

strat.plot for better looking stratigraphics diagrams and interp.dataset for interpolation and / or smoothing.

Examples

data(RLGH)
spec <- RLGH$spec
depth <- RLGH$depth$Depth

# interpolate new dataset to every 0.5 cm
# using default method (linear)
x.new <- seq(0, 20, by=0.5)
sp.interp <- interp.dataset(y=spec, x=depth, xout=x.new)
## Not run: 
# examine the results and compare to original data 
strat.plot.simple(spec, depth, sp.interp, x.new)
## End(Not run)

[Package rioja version 0.5-6 Index]