[Rd] NextMethod causes R 2.2.0 to crash (PR#8416)

Bill.Venables@csiro.au Bill.Venables at csiro.au
Wed Dec 21 04:32:54 CET 2005


I found writing the following default method the for the generic
function "julian" causes R to crash.


julian.default <- function(x, ...) {
        x <- as.Date(x)
        NextMethod("julian", x, ...)
}

Here is a test example 

> m <- as.Date("1972-09-27") + 0:10
> m 
 [1] "1972-09-27" "1972-09-28" "1972-09-29" "1972-09-30" "1972-10-01"
"1972-10-02" "1972-10-03"
 [8] "1972-10-04" "1972-10-05" "1972-10-06" "1972-10-07"
> class(m)
[1] "Date"
> julian(m)
 [1] 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
attr(,"origin")
[1] "1970-01-01"

> m <- as.character(m)
> class(m)
[1] "character"

> julian(m)

< R crashes>

--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 2.0
 year = 2005
 month = 10
 day = 06
 svn rev = 35749
 language = R



Bill Venables, 
CMIS, CSIRO Laboratories, 
PO Box 120, Cleveland, Qld. 4163 
AUSTRALIA 
Office Phone (email preferred): +61 7 3826 7251 
Fax (if absolutely necessary):    +61 7 3826 7304 
Mobile (rarely used):                +61 4 1963 4642 
Home Phone:                          +61 7 3286 7700 
mailto:Bill.Venables at csiro.au 
http://www.cmis.csiro.au/bill.venables/



More information about the R-devel mailing list