Skip to content
Prev 162092 / 398500 Next

Lattice: groups and no groups with panel.superpose

Hi,

I think the following code should do what you want,


		 xyplot(yvar~year|week,data=df,layout = c(4, 5),
		        type='p',
		        groups = temp ,
		        panel = function(x, y, ...) {
		        panel.superpose(x, y, ...)
		        panel.abline(lm(y~x))
		        },
		        panel.groups = function(x, y, ..., lty) {
		                panel.xyplot(x, y, ..., lty = lty)
		                panel.abline(lm(y~x), lty=3, ...)
		        })

Hope this helps,

baptiste
On 15 Nov 2008, at 14:25, Robert Buitenwerf wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag