[R] na.action in model.frame

Liaw, Andy andy_liaw at merck.com
Fri Jun 6 04:03:56 CEST 2003


Try:

  X <- model.frame(form=formula, data=mydata, na.action=na.pass)

Andy

> -----Original Message-----
> From: Ravi Varadhan [mailto:rvaradha at jhsph.edu]
> Sent: Thursday, June 05, 2003 12:02 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] na.action in model.frame
> 
> 
> Dear Group:
> 
> I am trying to create a model frame from a formula for the model as 
> follows:
> 
> formula <- y ~ x1 + x2 + x3
> X <- model.frame(form=formula,data=mydata)
> 
> I have some missing values in some the variables, but I want 
> them to be 
> included in my model frame and to be indicated as "NA". Is 
> there a way 
> to do this?
> 
> thanks,
> Ravi.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, cont... {{dropped}}




More information about the R-help mailing list