(Forgot to CC datatable-help, sorry):

setOldClass(c('data.frame'))
setOldClass(c('data.table', 'data.frame'))
Hi,

On Mon, Feb 21, 2011 at 10:04 PM, Peter Jackson <[email protected]> wrote:
>
> The following command
> setClass("ClusterGroup",representation=representation(dtDemand="data.table"))
> results in
> Warning message:
> undefined slot classes in definition of "ClusterGroup": dtDemand(class
> "data.table")
>
> I assume this means the class does not recognize data.table. Is there way to
> use data.table's in slots?

Yes,

I've actually been sitting on a patch for this for a long time due to
the difficulty of adding a unit test for this in the current framework
... long story, but I'll repost with an update on that in a separate
thread later.

It's simple to do what you want know, you'll need to have R run the
following lines before defining your class that contains data.table in
a slot:

setOldClass(c('data.frame'))
setOldClass(c('data.table', 'data.frame'))

Define your class after that, and it should work.

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to