[R] Polynomial question solved.

2011-04-20 Thread Erin Hodgess
Dear R People: Here is the solution: > polynomial(c(-2,1))*polynomial(c(-1,1)) 2 - 3*x + x^2 > Sorry for the trouble. Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com

[R] polynomial question

2011-04-20 Thread Erin Hodgess
Dear R People: Suppose I have (x-1)*(x-2) and would like to produce x^2 - 3x + 2. I have tried > polynomial(c(1,1)*c(2,1)) 2 + x from the polynom library, but as you can see, that doesn't do it. Is there a function to do this please? I'm sure that I've done this before, but I can't remember th