Skip to content

Putting an object in a data farme

2 messages · Duncan Murdoch, Brian Ripley

#
I'd like to use the modelling functions, in particular  model.frame,
with the S4 orientation objects I'm writing.  However, these use
data.frames, and data.frames object to having my objects put in them.
model.frame checks the mode of the object before it puts it in;
data.frame seems to be trying to coerce my class to data.frame, and
it's failing.

What's necessary to put a nonstandard object into a data.frame?

Duncan Murdoch
#
On Tue, 24 Jun 2003, Duncan Murdoch wrote:

            
That's probably not a good idea: I gave up for S-PLUS with S4 classes a 
long time back.  Too many utilities assumed that a classed object was a 
list with components like call and formula.
You need either to enclose it in I() or write an as.data.frame method for 
it, which may be difficult if it does not have an S3 class.

Brian