Re: [R] defining a function using strings

2008-10-16 Thread Gabor Grothendieck
Try this (to evaluate them at 10): polynomial.values(l, 10) On Thu, Oct 16, 2008 at 2:40 PM, Chernomoretz Ariel <[EMAIL PROTECTED]> wrote: > Hi All, > I need to evaluate a series expansion using Legendre polynomials. > Using the 'orthopolinom' package I can get a list of the first n > Legendre p

Re: [R] defining a function using strings

2008-10-16 Thread Dimitris Rizopoulos
try this: library(orthopolynom) l <- legendre.polynomials(4) fun.l <- lapply(l, as.function) fun.l[[3]](1:3) I hope it helps. Best, Dimitris Chernomoretz Ariel wrote: Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list

Re: [R] defining a function using strings

2008-10-16 Thread Rolf Turner
On 17/10/2008, at 7:40 AM, Chernomoretz Ariel wrote: Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list of the first n Legendre polynomials as character strings. library(orthopolynom) l<-legendre.polynomials(4) l [[1]]

[R] defining a function using strings

2008-10-16 Thread Chernomoretz Ariel
Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list of the first n Legendre polynomials as character strings. > library(orthopolynom) > l<-legendre.polynomials(4) > l [[1]] 1 [[2]] x [[3]] -0.5 + 1.5*x^2 [[4]] -1.5*x + 2.5*