Skip to content
Prev 67475 / 398506 Next

abline() with xyplot()

On Tuesday 12 April 2005 07:38, Chloe ARCHINARD wrote:
I'm not aware of anything called 'Xyplot' or 'Abline' (note that R is 
case sensitive).
'xyplot' is part of a graphics system that is different from standard R 
graphics. If you want to use it, you first need to learn how. 
help(Lattice) has some pointers that should get you started. 

In this case, you probably want something like

xyplot(m ~ ordered(l, levels=1),
       type="b", xlab="lagdist",
       ylab="Moran'I", lty=1, lwd=2, 
       cex=1.5, pch=pch, 
       panel = function(...) {
           panel.abline(h = 0, lty = 2)
           panel.xyplot(...)
       })

-Deepayan