[Rd] S4 objects in data frames?

From: Byron Ellis <byron.ellis_at_gmail.com>
Date: Wed, 19 Sep 2007 21:59:46 -0700

Is there any way to get S4 objects into a data frame and have the resulting data frame actually be printable?

After a good deal of work I managed to convert an S4 objects that holds several other objects into a data.frame object using a custom as.data.frame method, but I have been unable to discover how to make the result data.frame printable.

I've tried making format() generic, no dice. It eventually just wanders down the path to filter.default, which then tries to (incorrectly) unlist the contained S4 object. Obviously this doesn't work.

I can make a matrix of these objects without much trouble (there isn't a reasonable print function there either, but at least it doesn't error out).

Any clues? Someone who's managed to pull it off? I'm ready to do something horrible like create a wrapper class that extends character just to get it to work right, but this will be annoying for other reasons.

Byron Ellis (byron.ellis_at_gmail.com)
"Oook" -- The Librarian

R-devel_at_r-project.org mailing list
Received on Thu 20 Sep 2007 - 05:02:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Sep 2007 - 06:42:03 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.