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

Peter Ehlers ehlers at ucalgary.ca
Fri Jul 20 19:59:59 CEST 2012


On 2012-07-20 09:41, Rich Shepard wrote:
> On Fri, 20 Jul 2012, MacQueen, Don wrote:
>
>> I don't have a cenbox() function that I can find, but your solution will
>> (probably? hopefully?) be along the lines of:
>
> Don,
>
>     Well, I must have mis-typed that although I'm sure I read about it in the
> NADA.pdf or Dennis' book. I'll look again. I don't get an error when calling
> this method. Will look further and provide more information.
>
>> 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.
>
>     I will definitely work more on this. Right now I need to get my client to
> explain the many discrepancies in the data they sent before I go further
> with analyses.

Well, You didn't say (in your original request) that you were using
the NADA package. The function is cenboxplot() and it's just a
wrapper for boxplot() and hence passes arguments to boxplot().
Thus the solution to your problem is just to add the 'names='
argument, as in (using the example in ?cenboxplot):

   with(Golden, cenboxplot(Blood, BloodCen, DosageGroup,
                names = c("yabba", "doo")))

Peter Ehlers
p.s. I can sympathize with your client data troubles. 'Tis ever thus.

>
> Thanks very much,
>
> Rich
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list