[R] cenbox(): Changing Default x-axis Group Labels

MacQueen, Don macqueen1 at llnl.gov
Fri Jul 20 18:32:32 CEST 2012


Hi Rich,

I don't have a cenbox() function that I can find, but your solution will
(probably? hopefully?) be along the lines of:


foo <- boxplot( y ~ x, data=sdf, plot=FALSE)

foo$names <- ifelse(foo$names, "Label for TRUE", "Label for FALSE")

bxp(foo)


where sdf is a dataframe containing your data and y and x are appropriate
variables in it.


-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 7/18/12 2:30 PM, "Rich Shepard" <rshepard at appl-ecosys.com> wrote:

>   I've looked at the lattice book and the 'R Graphics Cookbook' without
>seeing how to change the labels along the x axis for groups in a box plot,
>specifically cenbox().
>
>   The attached example has a main and axes labels with default group
>labels.
>Please point me to a reference on how I can change 'FALSE' and 'TRUE' to
>something more easily understood by viewers.
>
>TIA,
>
>Rich



More information about the R-help mailing list