1.4.stackPlot | R Documentation |
Stack plot functions for Lattice.
stackPlot(x, data = NULL, ...)
#standard panels
panel.stackPlot(..., process=TRUE, plot=TRUE,
loa.settings = FALSE)
#data handlers
##currently not exported
x |
For |
data |
For |
... |
Additional arguments. |
loa.settings , plot , process |
|
stackPlot
generates a stack plot using the lattice framework.
panel.stackPlot
handles the appearance of triangle plot
outputs.
stackPlot
returns trellis objects, much like
conventional lattice
plot functions.
panel.stackPlot
is intended for use
within a trianglePlot
function call.
Development:
This is an in-development plot, and 'best handling' strategies have not been decided for several elements. So, future versions of these functions may differ significantly from the current version.
In particular:
stackPlot
:
The stackPlot
argument x
may include conditioning in the form
y ~ x | cond
. However, exact handling is has not been defined, so may
subject to change.
To generate the stacks, stackPlot
resets y
values by applying
y - min(y)
to each layer and then stacks them. It also generates a
second element y0
of asociated baselines. This is then used in
the form x = c(x, rev(x))
, y = c(y, rev(y0))
with
panel.polygon
to generate the stack layers.
panel.stackPlot
:
Code currently in revision. Please handle with care.
Karl Ropkins
These function makes extensive use of code developed by others.
As elsewhere, the use of lattice
is also gratefully acknowledged:
lattice: Sarkar, Deepayan (2008). Lattice: Multivariate Data Visualization with R. Springer, New York. ISBN 978-0-387-75968-5
In loa
: loaPlot
and panelPal
.
In other packages: xyplot
and panel.polygon
in lattice
.
## Example 1
## Basic stack plot usage
## Not run:
stackPlot(lead~dist.m, data=lat.lon.meuse)
stackPlot(cadmium+copper+lead+zinc~dist.m, data=lat.lon.meuse)
## End(Not run)
stackPlot(cadmium*40+copper*5+lead+zinc~dist.m, data=lat.lon.meuse)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.