[R] NULL or NA for missing function arguments?

Brahm, David David.Brahm at geodecapital.com
Mon Oct 16 23:06:44 CEST 2006


Hans-Peter <gchappi at gmail.com> wrote:
> I am troubled by the use of NULL or NA to indicate
> missing/non-specified function arguments.

I suggest using NULL for arguments which are vectors or lists of
unspecified length, and NA for "scalars" (arguments whose length
should always be one, such as na.rm).  I rarely use missing arguments,
as they are harder to pass down to other functions.

-- David Brahm (brahm at alum.mit.edu)



More information about the R-help mailing list