s-news
[Top] [All Lists]

Re: allowing for missing arguments in functions

To: Eric yang <yang_eric9@yahoo.com>
Subject: Re: allowing for missing arguments in functions
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Fri, 25 Nov 2005 07:43:07 -0600
Cc: s-news@wubios.wustl.edu
In-reply-to: <20051125120744.14934.qmail@web33906.mail.mud.yahoo.com>
Organization: PDF Solutions, Inc.
References: <20051125120744.14934.qmail@web33906.mail.mud.yahoo.com>
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)


Eric yang wrote:
Dear members, I've created a function that reads in 10 arguments in the function call, example my.fun <- function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) { ... } I use all the arguments in the body of the function. Is there a neat way of allowing for missing arguments in the function call and not executing the code in the body of the function that refers to the missing arguments? Any help is much appreciated. Eric

Take a look at ?missing.

--sundar

<Prev in Thread] Current Thread [Next in Thread>