[R] returns the value of a polynomial of degree n evaluated at x.

McClatchie, Sam (PIRSA-SARDI) mcclatchie.sam at saugov.sa.gov.au
Mon Aug 9 04:55:09 CEST 2004


> 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><<
>




More information about the R-help mailing list