panel.ebars: Errorbar panel for Lattice graphics

View source: R/panel-ebars-function.R

panel.ebarsR Documentation

Errorbar panel for Lattice graphics

Description

This function has been designed for plotting of errorbars in lattice plots. It handles both x and y-errorbars as well as asymmetrical and symmetrical errorbars. Sevarel features such as the whisker widths and other praghical parameters can be controlled. Furthermore, the error bars can be offset from the main data point, and the inner part of the bars can be set not to be drawn (such that the main data point stands out). The function can also plot a single point without use of panel.xyplot or panel.superpose.

Provide either x.minus or x.plus or use x.err if the errorbar is symmetrical. Likewise for the y-errorbar. Apply NA values for errorbars that should not be plotted (e.g. if they are within symbols). See also panel.binned.errorbars, panel.ebars2 and panel.ebars.grouped.

Usage

See the function panel.ebars.demo

Arguments

x

= x-coordinate for the data points.

y

= y-coordinate for the data points.

x.wanted

= TRUE means that the x-errorbars will be plotted.

y.wanted

= TRUE means that the y-errorbars will be plotted.

x.err

= the size of symmetrical x-errorbars (i.e. x.err = x.minus = x.plus). Note, that x.err, x.minus, or x.plus must be of the same length as x and y. This is so because these vectors are manipulated deeper down using the subscripts argument. Also, note that it is not enough to just set x.err etc. equal to a named column in the main dataframe. So, if the main dataframe is called df, and if it contains a column called u.Gy that you want to use as errorbar, then you must write x.err = df$u.Gy (it is NOT enough to write x.err = u.Gy even though data=df). Likewise, if you want to set the errorbar to a constant value, you must use something like x.err = rep(2.3,nrow(df)) rather than just x.err = 2.3.

x.minus

= the size of the lower x-errorbars (if assymetrical)

x.plus

= the size of the upper x-errorbars (if assymetrical)

x.width

= the width (in mm) of the whiskers on the x-errorbars.

x.inner

= the free space (in mm) around the main data point where no part of the errorbas should be drawn.

x.offset

= the offset (in mm) of the x-errorbar.

gp.x

= graphical parameters for the x-errorbars.

gp.xwhisker

= graphical parameters for the whiskers for the x-errorbars.

point.wanted

= TRUE means that a separate point will be drawn at the central data.point.

gp.point

= graphical parameters for the separate data point to be drawn.

Value

A Lattice panel

Author(s)

Claus E. Andersen


claus-e-andersen/clanLattice documentation built on Oct. 14, 2023, 10:41 a.m.