[R] polynomial question

From: Erin Hodgess <erinm.hodgess_at_gmail.com>
Date: Wed, 20 Apr 2011 13:41:57 -0500

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 the correct way.


Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess_at_gmail.com

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 20 Apr 2011 - 18:44:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 20 Apr 2011 - 19:10:32 GMT.

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

list of date sections of archive