McClatchie, Sam (PIRSA-SARDI)
2004-Aug-09 02:55 UTC
[R] returns the value of a polynomial of degree n evaluated at x.
> Background: > OS: Linux Mandrake 9.1 > release: R 1.9.0 > editor: Xemacs 21.4 > frontend: ESS 5.1.23 > --------------------------------- > > Colleagues >Is there a function in R that is similar to polyval in matlab? (y polyval(p,x) returns the value of a polynomial of degree n evaluated at x. The input argument p is a vector of length n+1 whose elements are the coefficients in descending powers of the polynomial to be evaluated). <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/polyval.html> I have possibly missed it in the R help files, so please excuse me if I have. "Polynomial evaluation" yielded no result in a search of help, and the functions poly() and locpoly() don't seem to be what I am after.> Sam > ---- > Sam McClatchie, > Sub-program leader, Pelagic Fisheries > South Australian Aquatic Sciences Centre > PO Box 120, Henley Beach 5022 > Adelaide, South Australia > email <mcclatchie.sam at saugov.sa.gov.au> > Telephone: (61-8) 8200 2448 > FAX: (61-8) 8200 2481 > Research home page <http://www.smcc.150m.com/> > > /\ > ...>><xX(??> > //// \\\\ > <??)Xx><< > ///// \\\\\\ > ><(((??> > >><(((??> ...>><xX(??>O<??)Xx><< >
Prof Brian Ripley
2004-Aug-09 07:31 UTC
[R] returns the value of a polynomial of degree n evaluated at x.
See package polynom on CRAN. On Mon, 9 Aug 2004, McClatchie, Sam (PIRSA-SARDI) wrote:> Is there a function in R that is similar to polyval in matlab? (y > polyval(p,x) returns the value of a polynomial of degree n evaluated at x. > The input argument p is a vector of length n+1 whose elements are the > coefficients in descending powers of the polynomial to be evaluated). > <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/polyval.html> > > I have possibly missed it in the R help files, so please excuse me if I > have. "Polynomial evaluation" yielded no result in a search of help, and the > functions poly() and locpoly() don't seem to be what I am after.-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595