[R] Months in alphabetical order rather than chronological order in graph

David Winsemius dwinsemius at comcast.net
Fri Jan 28 23:17:41 CET 2011

On Jan 28, 2011, at 4:53 PM, Kurt_Helf at nps.gov wrote:
> Greetings
>     Though I have months in chronological order in my data table,  
> the data
> were sampled every other month (i.e., February, April, June, August,
> October, December), every time I try to plot them (on the x-axis)  
> they are
> plotted in alphabetical order.  What am I missing?

A reproducible example for one thing. A short sig for another.

 > monfac <- factor(month.name[sample(1:100)])
 > plot(monfac)
 > plot( factor(monfac, levels=month.name))

> Cheers
> Kurt
> ***************************************************************
> Kurt Lewis Helf, Ph.D.
> Ecologist


David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list