From byron.ellis at gmail.com  Thu Sep 20 06:59:46 2007
From: byron.ellis at gmail.com (Byron Ellis)
Date: Wed, 19 Sep 2007 21:59:46 -0700
Subject: [Rd] S4 objects in data frames?
Message-ID: <7098abec0709192159s4282265cre4cd07847b6b5da8@mail.gmail.com>

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



[Rd] S4 objects in data frames?
Byron Ellis