We will need a reproducible example!  Please give us R commands that display 
the behavior you're observing:

For example,

I am having trouble understanding the as.Date function.  When I input 39939, I 
would like to get "06.05.2009", but when I try it, I get 

> as.Date(39939)
Error in as.Date.numeric(39939) : 'origin' must be supplied

I looked up what origin Excel uses for its' dates, and it seems like it might 
be January 1, 1900, so I tried

as.Date(39939, origin = "1900-01-01")
[1] "2009-05-08"

Then we will much better be able to help you, because we will be able to paste 
your commands into R and see the results and make changes. 

But this still seems to be off by two days.  So did you really mean "06.05", or 
"08.05"?



-----Original Message-----
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of swertie
Sent: Tuesday, September 01, 2009 12:59 PM
To: r-help@r-project.org
Subject: [R] Date format in plot


Hello, I plot the abundance of a species in relation to the date. To have the
date as a continous variable I put it in the format "standard" in excel
(f.ex. 39939 means 06.05.2009). R uses 39939 on the x axis, but I would like
to have "06.05". I tried to use as.Date as suggested in some discussion but
I don't manage to use it, the returned date is not correct. Do you have any
clue? thank you

______________________________________________
R-help@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.

Reply via email to