I am attempting to construct a conditioning plot with a pair
of boxplots within each panel. The resulting plot has panels
misplaced. One misplaced panel is on top of the subcomponent
describing ranges of the conditioning variable. This is what I did:
X <- cut(rnorm(200), 2)
Y <- runif(200)
Z <- rnorm(200)
given.Z <- co.intervals(Z, number = 4, overlap = .25)
coplot(Y ~ X | Z, given.v = given.Z,
panel = function(x, y, ...){boxplot(y ~ x)})
Any suggestions as to why this does not work and what the
correct specification is would be greatly appreciated.
thanks,
Chuck Cleland
WinXP Pro
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 1
minor 6.2
year 2003
month 01
day 10
language R
Chuck Cleland wrote:> I am attempting to construct a conditioning plot with a pair of > boxplots within each panel. The resulting plot has panels misplaced. > One misplaced panel is on top of the subcomponent describing ranges of > the conditioning variable. This is what I did: > > X <- cut(rnorm(200), 2) > Y <- runif(200) > Z <- rnorm(200) > given.Z <- co.intervals(Z, number = 4, overlap = .25) > > coplot(Y ~ X | Z, given.v = given.Z, > panel = function(x, y, ...){boxplot(y ~ x)}) > > Any suggestions as to why this does not work and what the correct > specification is would be greatly appreciated. >Not sure, but you might want to try boxplot(y ~ x, add = TRUE). When I did this I had to add xlim = c(0, 3) so the boxplots were drawn completely within the panel. Sundar