Hello all,
I am making boxplots of numerous variables using months as the grouping factor
(months here is indeed a factor). I am using gui plots as opposed to command
line only for their greater flexibility.
The problem I'm running into is that the boxplots (which plot numerically
correctly) are produced in alphabetical order, which pretty much kills their
utility as monthly groupings :).
I reviewd all of the "box" functions (command and gui) and didn't find anyway
to control the order of placement. I thought of trying months() to force
somekind of internal order, so I tried months() on my timeDate field, and
voila! perfect ordering.
So, my question is kind of general... how can I coerce a placement order for
boxplots, etc. when an internal ordering (such as months) is not appropriate or
available. Lets say I have three factors, B, S, and V. If I plot those up, they
will plot in that (alphabetic) order. But say the correct order for my purposes
is actually S,V,B (or whatever)...
I see that
is.factor(months(mydata$timeDate))
[1] T
but beyond that I do not understand how months() sets up the ordering, because
> months()
yields no info. I guess this is an internal method, or function that is not
visible??
My original "months" column is also a factor, with the exception that under
"Properties", the order ("Apr", "Aug" , "Dec"...) is alphabetical, as opposed
to calendrical (new word ? :):). The coerced months factor (which works
correctly) has the order ("Jan", "Feb", "Mar" ...) under "Properties". I tried
copying this order into the factor "Properties" of the original months", and
hosed the order really well. I think it offset the order by some number;
obviously bad (but not understood).
I'm Running 6.0 R2 on windows 2K @ 87 octane
Any ideas are greatly appreciated.
regards
Michael Slattery
Geologist, Ohio EPA
Columbus OH 43215
614-728-1221 (Ph)
614-644-2909 (Fax)
michael.slattery@epa.state.oh.us
|