On 11/10/08, Kenneth Roy Cabrera Torres <[EMAIL PROTECTED]> wrote:
> Hi R users:
>
>  How can I obtain with bwplot boxplots with bwplot whose box width
>  will vary acording to other variable.
>
>  bwplot(categ1~continuos|categ2,box.ratio=continuos2,data=data.base)
>
>  But it doesn't work as I expected.

I'm not really sure what you expected. The best I would have expected
is that 'box.ratio' in panel.bwplot is vectorized, and that seems to
be true; so you can do

bwplot(gl(4, 1, 100) ~ rnorm(100), box.ratio = 1:4)

or more directly

bwplot(gl(4, 1, 100) ~ rnorm(100), box.width = (4:1)/4)

If you want the widths to be controlled by another variable, you will
need to write your own panel function that calls panel.bwplot with a
suitable 'box.width' argument. I don't see any obvious rule, since the
number of individual box-and-whisker plots is smaller than the number
of observations.

-Deepayan

______________________________________________
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.

Reply via email to