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

Frank E Harrell Jr f.harrell at vanderbilt.edu
Wed Apr 25 05:46:05 CEST 2007

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.

Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list