[R] lattice cloud and conditional axis limits

From: Karl Ove Hufthammer <karloh_at_mi.uib.no>
Date: Tue 12 Sep 2006 - 12:30:45 GMT


I'm using the 'cloud' function in the 'lattice' package to produce multi-panel 3D scatter plots. The range of the values used vary much between each panel (especially on the z axis), so I wish the axis limits to be calculated based on the (conditional) data.

Here's a minimal example:

library(lattice)

z=1:200
x=runif(200)
y=runif(200)
s=factor(rep(c(1,2),each=100))

cloud(z~x*y|s,scales=list(arrows=FALSE))

On the first panel, the z values are in the range [1,100], and on the second panel, they are in the range [101,200]. I wish the z axis to reflect this, i.e., to only span these values. (In my actual data sets, this does make more sense than in this example.) If 'cloud' worked the same way the 'xypanel' function does, one of the following would work:

cloud(z~x*y|s,scales=list(arrows=FALSE,z=list(relation="free"))) cloud(z~x*y|s,scales=list(arrows=FALSE,relation="free"))

However, it does not. Any ideas how I can make it work?

-- 
Karl Ove Hufthammer
E-mail and Jabber: karl@huftis.org

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Sep 12 22:39:02 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 13 Sep 2006 - 00:30:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.