Re: [R] The use of F for False and T for True

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Mon, 17 Nov 2008 09:42:47 -0800

To save my fingers and still being on the safe side, I always do:

> !0

[1] TRUE
> !1

[1] FALSE ;) ...still hackable though.

/Henrik

On Mon, Nov 17, 2008 at 5:25 AM, Duncan Murdoch <murdoch_at_stats.uwo.ca> wrote:
> On 17/11/2008 8:03 AM, hadley wickham wrote:

>>
>> On Sun, Nov 16, 2008 at 7:41 PM, Simon Blomberg <s.blomberg1_at_uq.edu.au>
>> wrote:
>>>
>>> It is better programming practice to use FALSE for false and TRUE for
>>> true, and not F and T. This is because it is quite legal to do this:
>>>
>>> T <- FALSE
>>> F <- TRUE
>>
>> It may be better programming practice, but is it better interactive
>> data analysis practice?  R isn't just a programming language, and
>> there are lots of good reasons to provide shortcuts that reduce
>> typing.  It's very easy to forget that most people can't touch type at
>> a decent speed, and every key press less helps them get their ideas
>> from their head to the computer faster.
>

> That would be an argument for T and F being the reserved words (as I think
> they are in S-PLUS). But since it's so easy to use T or F as a variable,
> the problems caused by using them as TRUE or FALSE are not negligible --
> look at the original question in this thread, which was likely caused by
> using F as a variable.
>

> Duncan Murdoch
>

> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 17 Nov 2008 - 17:48:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 20:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive