[Rd] S4 changes - sp fails

Roger Bivand Roger.Bivand at nhh.no
Thu Aug 31 22:16:44 CEST 2006


Under R version 2.4.0 (2006-08-30 r39024), sp fails CMD check following
the latest changes in methods.

The failures are in running examples and occur in CMD check:

> data(state)
> dd2dms(state.center$x)
Error in function (classes, fdef, mtable)  : 
        unable to find an inherited method for function "initialize", for 
signature "integer"

Offending code:

	deg <- as(floor(dd), "integer") 

After replacing by as.integer(floor(dd)), it fails on the local class 
definition:

> dd2dms(state.center$x)
Error in function (classes, fdef, mtable)  : 
        unable to find an inherited method for function "initialize", for 
signature "DMS"

Installing sp, example("DMS-class") runs successfully interactively 
(other examples do too).

The methods package is declared as Depends: in DESCRIPTION, and
import(methods) in NAMESPACE; 

.onLoad <- function(lib, pkg) require(methods) is in the first R source 
file in Collate: order.

Should the methods package be being invoked in some other way, is there a 
reason why the installed package appears to run examples successfully that 
fail under CMD check?

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-devel mailing list