R gives you facilities for doing this (using '...' and 'missing') without
passing in a data.frame. For example,
> foo <- function(arg1,arg2,...) { if (missing(arg1)) cat('missing arg1\n');
> print(list(...)) }
> foo(1,2,arg3=3,arg4=4,arg5=5)
$arg3
[1] 3
$arg4
[1] 4
$arg5
[1] 5
> foo(arg2=2
Jim,
Thanks for your comments.
KW
--
On May 6, 2013, at 5:48 PM, Jim Lemon wrote:
> see inline
>
> On 05/07/2013 02:14 AM, Keith S Weintraub wrote:
>> Folks,
>>
>> I have been working on an R project that has a few dozen functions.
>>
>> I have some questions that are only tangentially re
see inline
On 05/07/2013 02:14 AM, Keith S Weintraub wrote:
Folks,
I have been working on an R project that has a few dozen functions.
I have some questions that are only tangentially related and might only be a
difference in style.
1. Some of my functions take single-row data.frames as inpu
1. I would not presume to "advise" on good style. However, I will note
that for your question (1) , default arguments and the "..." argument
appears to be more standard. e.g. the function should be written as:
myfunc(a1, a2, a3= something1, a4 = something2, ...)
where arguments a1 and a2 are requ
Folks,
I have been working on an R project that has a few dozen functions.
I have some questions that are only tangentially related and might only be a
difference in style.
1. Some of my functions take single-row data.frames as input parameters lists.
I don't force the user of the function to
5 matches
Mail list logo