[R] Creating a Model Matrix - keeping NAs

Rachel Cunliffe rachel at stat.auckland.ac.nz
Mon Aug 13 01:27:44 CEST 2001


I am wanting to create a model matrix and keep the NAs.

stratmat <- model.matrix(myformula,mydata)

Is there any way to do this?  model.matrix doesn't have na.action as a
parameter.  Elsewhere I have made use of na.keep <- function(x){x}.

Many thanks,

Rachel Cunliffe

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list