[R] Sloppy argument checking for named arguments

Christian Lederer christianlederer at t-online.de
Thu Jun 3 06:20:03 CEST 2004


Dear R Gurus,

i recently noticed that R does sloppy argument checking for named
arguments, if the argument contains a dot.
Example:

 > f <- function(foo.bar=0) { print(foo.bar) }
 > f(foo=1)
[1] 1

I guess, this should be considered as a bug.
Anyway, the consequence is that bugs caused by typing errors
of this kind may are *very* hard to discover in complex progams.

Christian




More information about the R-help mailing list