From ripley at stats.ox.ac.uk  Wed Apr 25 14:49:15 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 25 Apr 2007 13:49:15 +0100 (BST)
Subject: [Rd] [R] Coercing data types for use in model.frame
In-Reply-To: <462ECEFD.8010705@vanderbilt.edu>
References: <462ECEFD.8010705@vanderbilt.edu>
Message-ID: <Pine.LNX.4.64.0704251014120.2746@gannet.stats.ox.ac.uk>

Moved to R-devel ....

What is the 'data class'?  In particular what is its underlying type? And 
where in model.frame[.default] are you trying to use it (in the formula, 
data, in ..., etc).

This is an example of where some reproducible code and the error messages 
would be very helpful indeed.

Brian

On Tue, 24 Apr 2007, Frank E Harrell Jr wrote:

> In the Hmisc package there is a new data class 'mChoice' for multiple
> choice variables.  There are format and as.numeric methods (the latter
> creates a matrix of dummy variables).  mChoice variables are not allowed
> by model.frame.  Is there a way to specify a conversion function that
> model.frame will use automatically?  I would use as.factor here.
> model.frame does not seem to use as.data.frame.foo for individual variables.
>
> Thanks
> Frank
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] [R] Coercing data types for use in model.frame
Prof Brian Ripley