Hi,
I would like to evaluate a function, with 3 arguments, for instance,
myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c
}
How to execute myfunc(x,y,z), for all x, all y and all z, where x,y,z are
vectors?
Thank you very much in advance
--
View
You mean executing the function for all combinations of values?
For example, if you have a-b-c-1:2
you would get back the values of
myfunc(1,1,1)
myfunc(1,1,2)
myfunc(1,2,1)
myfunc(1,2,2)
myfunc(2,1,1)
myfunc(2,1,2)
myfunc(2,2,1)
myfunc(2,2,2)
?
On 20.07.2012, at 13:05, carla moreira wrote:
Not quite sure what you are aiming at, but looking at ?mapply or ?expand.grid
could be helpful
Benno
On Jul 20, 2012, at 1:05 PM, carla moreira wrote:
Hi,
I would like to evaluate a function, with 3 arguments, for instance,
myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c
Yes, I do.
But I need to control how the permutations are done.
Thank you.
2012/7/20 Jessica Streicher j.streic...@micromata.de
You mean executing the function for all combinations of values?
For example, if you have a-b-c-1:2
you would get back the values of
myfunc(1,1,1)
myfunc(1,1,2)
Well, what do you want to control there?
Need a subset? Need an ordering?
On 20.07.2012, at 15:00, Carla Moreira wrote:
Yes, I do.
But I need to control how the permutations are done.
Thank you.
2012/7/20 Jessica Streicher j.streic...@micromata.de
You mean executing the function
On 2012-07-20 04:05, carla moreira wrote:
Hi,
I would like to evaluate a function, with 3 arguments, for instance,
myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c
}
How to execute myfunc(x,y,z), for all x, all y and all z, where x,y,z are
Inline.
-- Bert
On Fri, Jul 20, 2012 at 6:59 AM, Peter Ehlers ehl...@ucalgary.ca wrote:
On 2012-07-20 04:05, carla moreira wrote:
Hi,
I would like to evaluate a function, with 3 arguments, for instance,
myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c
Bert,
The only thing wrong is that I'm still 75% asleep! Yikes!!
Thanks for the heads-up.
Carla: See Bert's solution.
Peter Ehlers
On 2012-07-20 07:10, Bert Gunter wrote:
Inline.
-- Bert
On Fri, Jul 20, 2012 at 6:59 AM, Peter Ehlers ehl...@ucalgary.ca wrote:
On 2012-07-20 04:05, carla
Yes,
that's this.
Thank you very much.
2012/7/20 Peter Ehlers [via R] ml-node+s789695n463721...@n4.nabble.com
On 2012-07-20 04:05, carla moreira wrote:
Hi,
I would like to evaluate a function, with 3 arguments, for instance,
myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c
9 matches
Mail list logo