Re: [Rd] suggested addition to model.matrix

2016-10-04 Thread William Dunlap via R-devel
> > -Original Message- > > From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of > Spencer > > Graves > > Sent: October 3, 2016 7:59 PM > > To: r-devel@r-project.org > > Subject: [Rd] suggested addition to model.matrix > > > >

Re: [Rd] suggested addition to model.matrix

2016-10-03 Thread Fox, John
ormula. Best, John > -Original Message- > From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Spencer > Graves > Sent: October 3, 2016 7:59 PM > To: r-devel@r-project.org > Subject: [Rd] suggested addition to model.matrix > > Hello, All: > > >

[Rd] suggested addition to model.matrix

2016-10-03 Thread Spencer Graves
Hello, All: What's the simplest way to convert a data.frame into a model.matrix? One way is given by the following example, modified from the examples in help(model.matrix): dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) ab <- model.matrix(~ a + b, dd) ab0 <- model.matrix(~.,