From jmc at research.bell-labs.com  Fri Jun 13 14:18:23 2003
From: jmc at research.bell-labs.com (John Chambers)
Date: Fri Jun 13 19:18:51 2003
Subject: [Rd] Problem with Rcmd check and S4 methods
References: <72ujevgnr0vt1hop4kbb1v9tfqd3e36a98@4ax.com>
Message-ID: <3EEA075F.65BBB200@research.bell-labs.com>

Duncan Murdoch wrote:
> 
> In the little orientation data package I'm working on, the very first
> example fails, even though the same code works when used in a regular
> session.  In my experience, this usually indicates T or F has been
> used instead of TRUE or FALSE, but that's not the case this time.
> 
> The error message is
> 
>  > x <- eulerzyx(1,0,0)4bb
>  Error: Trying to get slot "validity" from an object of a basic class
> ("NULL") with no slots
>  Execution halted
> 
> What I think is the relevant source looks like this:
> 
> setClass('orientation')
> setIs('orientation','vector')
> 
> setClass('eulerzyx', representation(x = 'matrix'))
> setIs('eulerzyx', 'orientation')
> 
> eulerzyx <- function(psi, theta, phi)
>     new('eulerzyx', x = cbind(psi, theta, phi))
> 
> Can anyone tell me what that error message means? 

The code has a NULL object that was supposed to be a class definition
(and therefore to have a "validity" slot).
 

> Is it something
> I've done wrong, or a problem with the methods package or the checks?

I was able to add your source & the one-line example to a small package
and get through R CMD check.

Can you do example(eulerzyx) after attaching the package?

Are you using a saved image (e.g., with an empty install.R file in the
package directory)?  (Though if not, the check would often fail at an
earlier stage.)

It would be nice to be able to get a dump from the R CMD check
evaluation--maybe someone can suggest how.

John
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

-- 
John M. Chambers                  jmc@bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-2681
700 Mountain Avenue, Room 2C-282  fax:    (908)582-3340
Murray Hill, NJ  07974            web: http://www.cs.bell-labs.com/~jmc


[Rd] Problem with Rcmd check and S4 methods
John Chambers