Skip to content
Prev 70132 / 398503 Next

R annoyances

Prof Ripley,

I'm aware of R CMD check, but who uses it? Not many regular users, I
presume. As long as T/F are allowed to stand for TRUE/FALSE without
being reserved words, there will be users who will fall in the trap.

As your example shows, some code would have to be manually converted.
Avoiding the difficult conversion may well be considered more
important than ensuring that new/intermediate R users don't get into
trouble. (After all, it's the experts who make the decisions, and who
have a large investment in existing code.) From another perspective
though, the total quantity of past, current - and especially future -
T/F mistakes made by the new members of a rapidly increasing R user
base may outweigh the difficulties the experts would have to go
through to convert their code.
b.


-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
Sent: Friday, May 20, 2005 9:39 AM
To: bogdan romocea
Cc: R-help at stat.math.ethz.ch
Subject: RE: [R] R annoyances
On Fri, 20 May 2005, bogdan romocea wrote:

            
You do realize that R CMD check checks for use of unassigned T/F?  So it 
would only be unchecked code which did that.
I assure you it is a *lot* harder than that.  Some of us use spaces for a 
start. No sed script can know the difference between

F <- "2";  as.numeric(x = F)
F <- "2";  as.numeric(x = FALSE)

(I know because I used to share code bases for S-PLUS and R, and had Perl 
scripts to do the conversion that worked for my style, but not for some 
other authors' code.)