Re: [R] add transformed columns into a matrix

From: Bjørn-Helge Mevik <bhx2_at_mevik.net>
Date: Tue 28 Jun 2005 - 21:12:27 EST

Supposing 'inmatrix' is a matrix with coloumn names 'x1', 'x2' and 'x3'; how about something like

model.matrix(~ (x1 + x2 + x3)^2 + log(x1) + log(x2) + log(x3) +

             sqrt(x1) + sqrt(x2) + sqrt(x3) - 1,
             as.data.frame(inmatrix))

-- 
Bjørn-Helge Mevik

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 28 21:17:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:04 EST