|
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 ______________________________________________ [hidden email] 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. |
|
Code?
Sample data? John Kane Kingston ON Canada > -----Original Message----- > From: [hidden email] > Sent: Wed, 18 Jul 2012 14:30:24 -0700 (PDT) > To: [hidden email] > Subject: [R] cenbox(): Changing Default x-axis Group Labels > > 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 > ______________________________________________ > [hidden email] 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. ____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop! ______________________________________________ [hidden email] 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. |
|
In reply to this post by Rich Shepard
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" <[hidden email]> 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 ______________________________________________ [hidden email] 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. |
|
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. Thanks very much, Rich ______________________________________________ [hidden email] 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. |
|
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 > > ______________________________________________ > [hidden email] 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. > ______________________________________________ [hidden email] 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. |
|
On Fri, 20 Jul 2012, Peter Ehlers wrote:
> 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, Thank you. I wrote off the top of my head and obviously missed the correct function name. > p.s. I can sympathize with your client data troubles. 'Tis ever thus. Yep. They all use spreadsheets rather than databases and there's no integrity checks. Sigh. Well, the pay's the same regardless. Carpe weekend, Rich ______________________________________________ [hidden email] 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. |
| Powered by Nabble | Edit this page |
