[R] Plot with Julian dates.

C. Park cspark at ces.clemson.edu
Wed Aug 9 21:31:48 CEST 2006


Dear Sir/Madam:

I simply want to draw x-y plot with Julian dates (x) and numbers (y).
Please see below for my program.

In the older version of R, the plot(jdat, miles) worked without any problem.
But, with the new version of R, plot(jdat, miles) does not work any more. 
So, I added log="" option (as far as I know, it is a default setting, so
log="" should not be needed). 
Now, it works with log="" option. But it is weird to me. 

I also check
plot( jdat, miles, log="", type="p")

The option type="p" is also a default. So it should be the same as 
plot( jdat, miles, log=""). The figures are the same, but the one with 
type="p" option yields a warning message. 

Do you think it is a R bug?
Thanks for your valuable time.
C. Park

Note: I used the following R version                         
platform       i686-redhat-linux-gnu     
arch           i686                      
os             linux-gnu                 
system         i686, linux-gnu           
status                                   
major          2                         
minor          3.1                       
year           2006                      
month          06                        
day            01                        
svn rev        38247                     
language       R                         
version.string Version 2.3.1 (2006-06-01)

##=========================================
## Here is my program
##=========================================

library(survival)

dat = c( "12-5-1995",  "12-30-1995", "8-27-1996", "11-20-1996", "8-29-1997",
         "11-7-1997",  "4-4-1998",   "7-15-1998", "11-2-1998",  "1-16-1999" )
miles = c(106,   1468, 7298, 7935, 13440,  14460, 17132, 20214, 22802, 24724 )
jdat = as.date(dat)   ## Convert to Julian date form.

 plot( jdat, miles )   ## Not working
Error in plot.window(xlim, ylim, log, asp, ...) : 
        "log=" specification must be character

 plot( jdat, miles, log="" )  ## Works

 plot( jdat, miles, log="", type="p") ## Works, but warning messages
Warning message:
graphical parameter "type" is obsolete in: axis(side, at, labels, tick, line,
pos, outer, font, lty, lwd,



More information about the R-help mailing list