[R] Labeling barplot bars by multiple factors

Thomas Levine thomas.levine at gmail.com
Thu May 28 21:50:52 CEST 2009


Ah, that makes sense. But now another two issues have arisen.

Firstly, the error bars look like confidence intervals, and I'm pretty
sure that they are but does some document verify this? I suppose I
could check the code too.

Secondly, I just read about how dynamite plots should be avoided. It's
quite easy to turn the dynamite plots into dot plots with Inkscape,
but is there an equivalent function that generates _hierarchical_ dot
plots?

Tom

On Thu, May 28, 2009 at 12:32 PM, William Dunlap <wdunlap at tibco.com> wrote:
>> -----Original Message-----
>> From: r-help-bounces at r-project.org
>> [mailto:r-help-bounces at r-project.org] On Behalf Of Thomas Levine
>> Sent: Thursday, May 28, 2009 5:04 AM
>> To: Jim Lemon
>> Cc: r-help at r-project.org
>> Subject: Re: [R] Labeling barplot bars by multiple factors
>>
>> Both of those worked, but hierobarp looked a bit easier, so I
>> used that. The
>> one annoying thing is that it sorts alphabetically.
>>
>> Tom
>
> The sorts of functions almost always order things by
> the order of the levels of your factors.  The default ordering
> is alphabetical (or increasing numeric, if your factor
> was made from numerical data).  To change the order remake
> the factor and supply the levels argument.  E.g., to reverse the
> order use rev:
>    data$someFactor <- factor(data$someFactor,
> levels=rev(levels(data$someFactor)))
>
> Bill Dunlap
> TIBCO Software Inc - Spotfire Division
> wdunlap tibco.com
>
>>
>> On Thu, May 28, 2009 at 6:46 AM, Jim Lemon <jim at bitwrit.com.au> wrote:
>>
>> > Thomas Levine wrote:
>> >
>> >> I want to plot quantitative data as a function of three
>> two-level factors.
>> >> How do I group the bars on a barplot by level through labeling and
>> >> spacing?
>> >> Here
>> <http://www.thomaslevine.org/sample_multiple-factor_barplot.png>'s
>> >> what
>> >> I'm thinking of. Also, I'm pretty sure that I want a
>> barplot, but there
>> >> may
>> >> be something better.
>> >>
>> >>
>> >>
>> > Hi Tom,
>> > You may find that the hierobarp function in the plotrix
>> package will do
>> > what you want.
>> >
>> > Jim
>> >
>> >
>>
>>       [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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