Displaying 2 results from an estimated 2 matches for "week_num".
2010 Dec 09
4
[lattice xyplot] Help needed in help in customizing the panel.abline() function
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.abline(v = 8, lty = 2)
panel.xyplot(...)
})
Is there a way I can give panel.abline() input from a which.max() function?
Essentially I need the vertical line to be drawn at the week_num
correspond...
2010 Dec 11
0
is there a packge or code to generate markov chains in R
...t r-project.org
Subject: Re: [R] [lattice xyplot] Help needed in help in customizing
the panel.abline() function
Message-ID:
<AANLkTimD6dRUkkjEhW4-sB8CBDcFVASRRKkF6Xex+cb9 at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
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. <garamach at gmail.com> wrote:
>
> Hi folks,
>
> I need some he...