From ggrothendieck at gmail.com  Wed Jan 30 00:13:06 2013
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Tue, 29 Jan 2013 18:13:06 -0500
Subject: [Rd] Creating ref class with same name as S4 class results in error
Message-ID: <CAP01uRmEkThRAw53XJEsXs3dTYDT6dpG+44F95uPiYmSJKP_sQ@mail.gmail.com>

It seems that if one overwrites an S4 class with a Reference Class of
the same name that one gets an error in the situation below. I would
have expected that the Reference Class would replace the S4 class in
such a way that one could now use the Reference Class.

> A <- setClass("A", representation(x = "ANY"))
> x <- A()
> A <- setRefClass("A", fields = "a")
> x <- A$new(a = 1)
Error in initialize(value, ...) : invalid names for slots of class "A": a
> R.version.string
[1] "R version 2.15.2 Patched (2013-01-17 r61672)"

I got the same result on:

 "R Under development (unstable) (2013-01-25 r61745)"

Both were run under Windows 8 64 bit.

--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



[Rd] Creating ref class with same name as S4 class results in error
Gabor Grothendieck