Skip to content
Prev 10174 / 63424 Next

S4 methods bug in naming of slots (PR#3665)

On Wed, Aug 06, 2003 at 06:26:53AM +0200, statwy@stat.nus.edu.sg wrote:
It is not really a bug. If you look at the definition of the function
 new you will see that its first argument is named Class. The argument
 you want to use for the C slot gets matched to the Class argument -
 it isn't a class and you get an error message. So, to avoid
 the partial matching algorithm for matching fucntions arguments you
 would need to go:
 
  new(Class="notok", A=diag(4), C=diag(4))

 which does work. Note also, no need for quotes around A and C.

 Robert

  
    
Message-ID: <20030806012602.D22791@jimmy.harvard.edu>
In-Reply-To: <200308060426.h764QrJH020539@pubhealth.ku.dk>; from statwy@stat.nus.edu.sg on Wed, Aug 06, 2003 at 06:26:53AM +0200