Girish A.R. wrote: > > Sorry, just realized that there was a typo in the following code of my > original post. The correct code is as shown below (corrected > 'data=swtop16' to 'data=DF'): > > sales <- xyplot(pct_inv_left ~ week_num|sku_num, data=DF,type = > "l",lwd=2,panel = function(...) { > panel.abline(h = 75, lty = 2) > panel.xyplot(...) > }) > > If it is really a constant not dependent on grouping, you could compute it in the parent; or, better probably, compute it in panel.abline()
Dieter .. Your data here ... maxWeek = DF$week_num[which.max (DF$cnt_gt50pct_disc)] sales <- xyplot(pct_inv_left ~ week_num|sku_num, data=DF,type = "l",lwd=2,panel = function(...) { panel.abline(h = 75, lty = 2) panel.abline(v = maxWeek, lty = 2) panel.xyplot(...) }) print(sales) -- View this message in context: http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3079698.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.