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

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 25 14:49:15 CEST 2007


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



More information about the R-devel mailing list