Thanks, Felix! That works.
best,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3081792.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi Girish,
Try this:
disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type =
"h",lwd=2,panel = function(x, y, ...) {
panel.abline(v = x[which.max(y)], lty = 2)
panel.xyplot(x, y, ...)
})
-Felix
On 9 December 2010 17:35, Girish A.R. wrote:
>
> Hi folks,
>
>
Thanks for the reply, Dieter.
I'm sorry I should have made it clear in my original post - the number
(output of which.max()) IS dependent on the grouping..
Thanks,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel
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(...) {
>
--
View this message in context:
http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3079697.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
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
Hi folks,
I need some help in customizing the abline() function to be used in a
lattice plot. I have attached a reproducible example below.
I need help in the following snippet:
disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type =
"h",lwd=2,panel = function(...) {
panel
7 matches
Mail list logo