panel.stat: Lattice panel for adding summary statistics to graphs

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

panel.statR Documentation

Lattice panel for adding summary statistics to graphs

Description

This function facilitates integration of summary statistics into lattice graphs. Requires grid, lattice and clanTools.

Usage

library(grid)
 library(lattice)
 library(clanTools)
 df.dum <- data.frame(dose=1:100, response=rnorm(100,mean=10,sd=0.1))
 xyplot(response ~ dose,
    panel=function(x,y,...){
    panel.xyplot(x,y,...)
    panel.stat(y)
    panel.stat(y,head="Summary:",unit="mSv",decimals=5,cx=0.65,dy=0.05)
 },
 data=df.dum)

Arguments

xx

is the vector of number to be analyzed

cx

is the x-position within the plot (0 - 1)

cy

is the y-position within the plot (0 - 1)

dx

is the increment in x coordinate from line to line (normally 0)

dy

is the increment in x coordinate from line to line

just

is the justification

decimals

isi the number of decimals

head

is the title of the statistics

unit

is the unit to be used

select

is a a 7-element vector controlling what statistics should be shown: Element 1: Mean Element 2: Sdandard deviation Element 3: Relative standard deviation in Element 4: N is the number of data points Element 5: Max is the maximum Element 6: Min is the minimum Element 7: Range (i.e. min to max)

...

is any additional formatting parameters

Value

A lattice panel.

Author(s)

Claus E. Andersen


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