[R] list of funtions

2012-09-13 Thread Jonathan Phillips
Hi, I have a function called fitMicroProtein which takes a value called form, this can be any integer from 0-38. In a larger function I'm making (it's called Newton), the first thing I want to do is construct a list of functions where form is already set. So in pseudocode fs[[1]](...) -

Re: [R] list of funtions

2012-09-13 Thread Uwe Ligges
On 13.09.2012 19:01, Jonathan Phillips wrote: Hi, I have a function called fitMicroProtein which takes a value called form, this can be any integer from 0-38. In a larger function I'm making (it's called Newton), the first thing I want to do is construct a list of functions where form is

Re: [R] list of funtions

2012-09-13 Thread Jonathan Phillips
Yes, seen it, and it's obviously the wrong thing to do or I'd be getting the result I'm looking for. But I can't see the correct way of doing it. I.e. I can't see any way of setting each element of the list to a function with a different 'form' value without using some 'i' like variable in a