1.5.loaBarPlot | R Documentation |
Bar plot variation using for Student Project.
loaBarPlot(x, y=NULL, groups=NULL, cond=NULL,
data=NULL, ..., drop.nas=TRUE, stat=NULL)
x |
Either the x case for the bar plot or a plot formula. If the x case, typically a vector of factor or grouping terms, used to assign x positions in bar plot. If a plot formula, a plot description in the format y~x|cond, where x is a factor or grouping term and y and cond are optional. |
y |
(Optional) The y case for the bar plot, typically a vector of numeric
terms, used with |
groups , cond |
(Optional) The group case for the bar plot, typically a vector of factor or grouping terms. |
data |
(Optional) if supplied, the assumed source
of the plot elements, |
... |
Additional arguments, passed on to |
drop.nas |
Option to drop |
stat |
If supplied, the function used to summarise |
loaBarPlot
summarises supplied plot data and generates a bar plot using the
lattice framework.
loaBarPlot
returns trellis objects, much like
conventional lattice
plot functions.
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:
loaBarPlot
:
This is for student project, may not be staying.
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
: listUpdate
and colHandler
.
In other packages: barchart
in lattice
.
## Example 1
## Basic bar plot usage
loaBarPlot(Species, Sepal.Width, data=iris, stat=mean)
#or equivalent using formula
## Not run:
loaBarPlot(Sepal.Width~Species, data=iris, stat=mean)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.