View source: R/panel.superpose.bubble.r
panel.superpose.bubble | R Documentation |
Panel function to create bubble plots where the symbol size varyies in proportion to a variable
panel.superpose.bubble(
x,
y,
n,
groups,
subscripts,
cols = NULL,
syms = NULL,
...
)
x, y |
numeric vectors x and y |
n |
the column containing the sample ie of each record |
groups |
grouping levels |
subscripts |
subscripts |
cols |
bubble colors |
syms |
bubbles symbol types |
... |
passed to llines() and lpoints() |
Lattice panel output (invisible)
library(lattice)
myData = data.frame( n = c(5,100,332,12,50,74)
, value = c(0.13,0.78,0.49,0.67,0.34,0.57)
, dose = c(20,25,50,30,40,35)
, sex = rep(c("M","F"), ea = 3)
)
myData = expand.data(myData, values = c(0,1,2,3,4), name = "time")
myData$ypred = myData$value * myData$time ^3/(1 + myData$time^3)
xyplot(ypred ~ time
, data = myData
, groups = dose
, subscripts = TRUE
, nn = sqrt(myData$n/10)
, panel = function(x,y, nn = nn, groups, subscripts,...)
{
panel.superpose.bubble(x,y,nn, groups, subscripts, ...)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.