[R] montly mean temp plot

Greg Snow Greg.Snow at imail.org
Tue Jun 2 21:27:56 CEST 2009


Without a reproducible example (we don't have month and X1999) it is hard to tell for sure, but my guess is that month is an (unordered) factor without the ordering specified, so it defaults to alphabetic.  Change it to a factor with the months properly ordered and the plot should match what you want.  One possible way to do this is:

> month <- factor(month, levels=month.name)

Or

> month <- factor(month, levels=month.abb)

Or if those don't work, then you will need to provide a set of months in the correct order that match with your data.

If that does not help, then send us more info on your month variable (str(month)), or better, a full reproducible example.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of ms.com
> Sent: Tuesday, June 02, 2009 10:33 AM
> To: r forum
> Subject: [R] montly mean temp plot
> 
> 
> Dear all
> i got a problem in monthly mean temperature. here i am attaching the
> data set as well as the plot i got with the following command
> plot(month,type='n')
> plot(month,X1999)
> 
> this command gave the plot where the month names are in alphabetic
> order, i want the plot in monthly sequence
> could you please suggest me how can i solve my problem?
> 
> thanking you
> 
> regard
> madan
> 
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that's right for you.




More information about the R-help mailing list