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

statwy at stat.nus.edu.sg statwy at stat.nus.edu.sg
Wed Aug 6 07:26:53 MEST 2003


Hello,

I am using R 1.7.1 on a Redhat Linux machine, version 7.3.
The following works fine: 

setClass("ok", representation(
      "A"       = "matrix",
      "Cmatrix" = "matrix"))

new("ok",
    "A" = diag(4),
    "Cmatrix" = diag(4))

But the following doesn't work:

setClass("notok", representation(
      "A" = "matrix",
      "C" = "matrix"))

new("notok",
    "A" = diag(4),
    "C" = diag(4))

It says

> new("notok",
+    "A" = diag(4),
+    "C" = diag(4))
Error in methodsPackageMetaName("C", name) :
        The name of the object (e.g,. a class or generic function) to find in the meta-data must be a single string (got an object of class "matrix")

Can this bug be fixed? It doesn't work in the Windows version either. 
Thanks in advance.

Thomas



More information about the R-devel mailing list