[R] polynomial expansion in R

From: yyan liu <zhliur_at_yahoo.com>
Date: Sat 01 Jul 2006 - 14:11:31 EST


Hi:

   I have two vectors of data, x and y and I want to get the "polynomial" expansion of (x+y)^p with any integer power p in R. Suppose p=2, then I want a matrix of five vectors, namely, x y x^2 y^2 x*y. The coefficient of the polynomial is not needed. I can write it manully if p is small. But I want it in the case of p=10 or even bigger, is there any function in R can do that automatically for me with certain choice of p?    Thx a lot!  

 liu                    


        [[alternative HTML version deleted]]



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 Sat Jul 01 14:44:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 02 Jul 2006 - 02:13:17 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.