[R] Assigning default function arguments to themselves: Why?
andrewH
ahoerner at rprogress.org
Mon Dec 30 00:19:09 CET 2013
Dear Bill--
I have seen it most often in functions that are defined or used inside of
other functions, and need an argument from the calling function. So I have,
purely as a matter of imitation, taken to doing it when I am writing a
function that wants an argument of the calling function passed to it
unchanged, because that is how I saw it used. So for instance, in
read.table(), scan() is called several times with reflexive argument
assignments that include:
file = file
what = what
sep = sep
quote = quote
comment.char = comment.char
allowEscapes = allowEscapes
encoding = encoding
Is this what you mean by an example that 'works'? I am sort of foggy on the
shade of meaning conveyed by the single quotes. If not, let me know what
kind of example you want, and I'll try and find it.
--
View this message in context: http://r.789695.n4.nabble.com/Assigning-default-function-arguments-to-themselves-Why-tp4682294p4682817.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list