[R] R annoyances

Jan T. Kim jtk at cmp.uea.ac.uk
Fri May 20 12:00:46 CEST 2005

On Thu, May 19, 2005 at 03:10:53PM -0400, John Fox wrote:

> Since you can use variables named c, q, or t in any event, I don't see why
> the existence of functions with these names is much of an impediment.

True, particularly since I'm not too likely to use these variables for (local)
functions, and variables of other types don't prevent functions from working.
(I thought this was a problem... I must be spoilt by recently having to read
too much Matlab code, where parentheses are used to both enclose subscripts and
parameter lists, thus rendering subscript expressions and function calls
syntactically indistinguishable.)

> The problem that I see with T and F is that allowing them to be redefined
> sets a trap for people. If R wants to discourage use of T and F for TRUE and
> FALSE, then why provide standard global variables by these names? On the
> other hand, if providing T and F is considered desirable (e.g., for S-PLUS
> compatibility), then why not make them reserved names?

Perhaps, it's a legacy code thing -- if there's both code relying on
T and F being aliases of TRUE and FALSE, and code using T or F as
variable names, then the situation cannot be resolved in either way
without breaking some code.

Best regards, Jan
 +- Jan T. Kim -------------------------------------------------------+
 |    *NEW*    email: jtk at cmp.uea.ac.uk                               |
 |    *NEW*    WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

More information about the R-help mailing list