From Roger.Bivand at nhh.no  Thu Aug 31 22:16:44 2006
From: Roger.Bivand at nhh.no (Roger Bivand)
Date: Thu, 31 Aug 2006 22:16:44 +0200 (CEST)
Subject: [Rd] S4 changes - sp fails
Message-ID: <Pine.LNX.4.44.0608312159380.5231-100000@reclus.nhh.no>

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




[Rd] S4 changes - sp fails
Roger Bivand