View source: R/panel-stat-function.R
panel.stat | R Documentation |
This function facilitates integration of summary statistics into lattice graphs. Requires grid, lattice and clanTools.
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)
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 |
A lattice panel.
Claus E. Andersen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.