[R] Custom ticks on x axis when dates are involved - many thanks!

Monica Pisica pisicandru at hotmail.com
Mon Nov 29 14:43:24 CET 2010


Hi,
 
I am sorry i am sending this again, but my email was snatched over the weekend by a spam generator and i was not able to send any email out. But now things are again back to normal. Even if i wrote to those who answered my question, i would like to let the list know that i got actually 2 solutions, both correct, but the following one is amazingly clear, short and to the point. I still struggle with the concept of dates in R.
 
Thanks a lot,
 
Monica

----------------------------------------
> Date: Thu, 25 Nov 2010 18:58:08 +1100
> From: jim at bitwrit.com.au
> To: pisicandru at hotmail.com
> CC: r-help at r-project.org
> Subject: Re: [R] Custom ticks on x axis when dates are involved
>
> On 11/25/2010 06:27 AM, Monica Pisica wrote:
> >
> > ...
> > Now the graph looks very close to what i want, but i know that my ticks actually are not exactly at 01/01/yyyy as i would like, although i suppose my error is not that much in this instance. However i would really appreciate if i can get the ticks on my x axis how i want in a much more elegant way - if possible (and if not at least in the correct way).
> >
> Hi Monica,
> How about this?
>
> mpdates<-as.POSIXct(paste("1/1",1984:2009,sep="/"),
> format="%d/%m/%Y")
> axis(1,at=mpdates,1984:2009,las=2)
>
> Jim 		 	   		  


More information about the R-help mailing list