| Stratiplot {analogue} | R Documentation |
Draws palaeoecological stratigraphic diagrams of one or more variables as a function of depth/age, with the time dimension flowing from the bottom to the top of the y-axis, using the Lattice graphics package.
Stratiplot(x, ...)
## Default S3 method:
Stratiplot(x, y, type = "l", ylab = "", xlab = "",
pages = 1, ...)
## S3 method for class 'formula':
Stratiplot(formula, data, subset, na.action, type = "l",
ylab = "", xlab = "", pages = 1, ...)
x |
matrix-like object; the variables to be plotted. |
y |
numeric vector of depths/ages corresponding to rows in
x. Length of y must be the same as nrow(x) or
exactly equal to nrow(x) / ncol(x). See Details. |
formula |
an object of class "formula" (or one that can be
coerced to that class): a symbolic description of the model to be
fitted. The details of plot specification are given under
‘Details’. |
type |
character; The type of plotting. Can be a vector. Note
that not all Lattice ‘type’s are supported and some new types
are allowed. See panel.Stratiplot for further
details. |
data |
an optional data frame, list or environment (or object
coercible by as.data.frame to a data frame) containing
the variables to plot. If not found in data, the variables
are taken from environment(formula), typically the
environment from which Stratiplot is called. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when
the data contain NAs. The default is set by the na.action
setting of options, and is na.fail if that is
unset. The ‘factory-fresh’ default is na.omit. Another
possible value is NULL, no action. Value na.exclude can be
useful. |
ylab, xlab |
the x- and y-axis labels. |
pages |
numeric; the number of pages to draw the plot over. May be useful for data sets with many species. |
... |
additional arguments passed to
panel.Stratiplot and the underlying
xyplot function. |
Currently the function is designed for relative abundance data only. Greater flexibility is planned in a future version.
Plots can be specified symbolically using a formula. A typical model
has the form Y ~ variables, where Y is either the core
depths or sample ages/dates (to be plotted on the y-axis) and
variables is a series of terms which specifies the variables to
plot against Y. Terms should be specified with the form
var1 + var2 + var3 to plot only those variables. Other,
standard, notation for formulae apply, such as model formulae used in
lm.
Note that formula is not passed on to
xyplot. Instead, the formula is parsed and evaluated
within Stratiplot and an appropriate data structure formed to
facilitate plotting via xyplot. As such, the special
features of Lattice formulae cannot be used.
Returns a Lattice plot object of class "trellis".
The function currently doesn't know about ages/dates and will interpret these as ‘depths’ instead. This will be fixed in a future version.
Gavin L. Simpson.
xyplot',
panel.Stratiplot, panel.Loess.
data(V12.122)
depths <- as.numeric(rownames(V12.122))
(plt <- Stratiplot(depths ~ O.univ + G.ruber + G.tenel + G.pacR,
data = V12.122,
type = c("h","l","g","smooth")))
(plt2 <- Stratiplot(depths ~ O.univ + G.ruber + G.tenel + G.pacR,
data = V12.122,
type = c("poly","g")))
(plt3 <- Stratiplot(depths ~ O.univ + G.ruber + G.tenel + G.pacR,
data = V12.122,
type = c("h")))
spp.want <- c("O.univ","G.ruber","G.tenel","G.pacR")
(plt4 <- Stratiplot(V12.122[, spp.want], y = depths,
type = c("poly", "g")))