[R] bwplot

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon May 5 21:13:17 CEST 2008


On 5/5/08, cfinet <cedric.finet at ens-lyon.fr> wrote:
> Hi,
>  I have 2 questions about bwplot in R :
>  1) How to change the order of my different boxes in the graph ?
>  2) How to rename the names of the differents boxes ? because I know how to
> do that with boxplot (using names) but I do not find the equivalent
> parameter in bwplot.

Both the labels and the order are derived from levels(y), where y is
the categorical variable in your boxplot. You can specify both when
you create a factor explicitly; see ?factor. (Also see
?reorder.factor, although I doubt that's what you want).

You can also change the labels in the bwplot call using xlim or ylim; e.g.,

bwplot(voice.part ~ height, data=singer, ylim = month.name[1:8])

-Deepayan



More information about the R-help mailing list