another thought possibly
fn = function(n, a=1, b=3) return(n*(a+b))
sapply(1:3, fn)
--
View this message in context:
http://n4.nabble.com/lapply-function-with-arguments-tp1838373p1838506.html
Sent from the R help mailing list archive at Nabble.com.
Thank you Jim
2010/4/13 jim holtman
> lapply(yourList, f, a=1, b=2)
>
> On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong
> wrote:
>
>> Dear R users,
>>
>> I have created a function f of n, a and b : f(n,a,b)
>>
>> I would like to apply this function several times to some values of n. a
>> and
lapply(yourList, f, a=1, b=2)
On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong wrote:
> Dear R users,
>
> I have created a function f of n, a and b : f(n,a,b)
>
> I would like to apply this function several times to some values of n. a
> and
> b are held constant. I was thinking of using lapply. Ho
Dear R users,
I have created a function f of n, a and b : f(n,a,b)
I would like to apply this function several times to some values of n. a and
b are held constant. I was thinking of using lapply. How can I do this ?
Thank you very much
Randall
[[alternative HTML version deleted]]
4 matches
Mail list logo