[R] Comparing two functions

2010-11-28 Thread Ira Sharenow
Hi. I am new to R and facing a problem that I cannot solve. I am writing some basic functions. Then I would like to have a master function that allows me to call one of the functions which I created, but I cannot figure out how to do so. Below is an example. The functions rnormIra and

Re: [R] Comparing two functions

2010-11-28 Thread baptiste auguie
Hi, Your function fails for a number of reasons. One of them is your comparison (use browser() to see what is the value taken by f in your function). Also, n, mean, min and max could not be extracted from ... with your construction. Here's my suggestion, randomIra = function(f=runif, ...){

Re: [R] Comparing two functions

2010-11-28 Thread Gabor Grothendieck
On Sun, Nov 28, 2010 at 5:53 AM, Ira Sharenow irasharenow...@yahoo.com wrote: Hi. I am new to R and facing a problem that I cannot solve. I am writing some basic functions. Then I would like to have a master function that allows me to call one of the functions which I created, but I cannot

Re: [R] Comparing two functions

2010-11-28 Thread Bert Gunter
It is perhaps worth mentioning in this context that in the R language, functions and language components (like formulas, expressions, etc.) are full first class objects -- which means basically that they can be treated like any data object: e.g. passed as arguments to a function, returned as