1.5.loaBarPlot: loaBarPlot

1.5.loaBarPlotR Documentation

loaBarPlot

Description

Bar plot variation using for Student Project.

Usage

   loaBarPlot(x, y=NULL, groups=NULL, cond=NULL, 
            data=NULL, ..., drop.nas=TRUE, stat=NULL)  

Arguments

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 stat when calculating summary information for bar plots.

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, x, y, groups and cond, typically a data.frame.

...

Additional arguments, passed on to lattice function.

drop.nas

Option to drop NAs before plotting results, default TRUE.

stat

If supplied, the function used to summarise y data after grouping by x, groups and cond. By default, this counts x cases if y is not supplied, or calculates sum of y values if these are supplied.

Details

loaBarPlot summarises supplied plot data and generates a bar plot using the lattice framework.

Value

loaBarPlot returns trellis objects, much like conventional lattice plot functions.

Note

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.

Author(s)

Karl Ropkins

References

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

See Also

In loa: listUpdate and colHandler.

In other packages: barchart in lattice.

Examples


## 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)
 

loa documentation built on Oct. 20, 2023, 5:09 p.m.