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

Rolf Turner r.turner at auckland.ac.nz
Mon Nov 17 02:13:39 CET 2008


On 17/11/2008, at 1:56 PM, David C. Howell wrote:

> Sampling with and without replacement
>
> I seem unable to use "replace = F" when I want to sample without
> replacement. I would think
> that it comes down to "F is not a legitimate abbreviation for FALSE."
> except that
> Dalgaard (p. 118) uses F for FALSE and it works
>  "pairwise.t.test(folate, ventilation, pool.sd = F)"
>
> I am having trouble when I try to sample a vector without replacement.
>
> The following code illustrates my problem.

	<snip>

(a) Naughty Peter.  It works, but is ill-advised.  The difference is
that FALSE is a reserved word (as is TRUE) but F and T are *not*  
reserved.

(b) Try find("F") --- I conjecture that you have an object named "F"
(not equal to FALSE) floating around somewhere in your search path.


Remove or rename this, and your ``replace=F'' will work.

But .... ***DON'T DO THAT***!!!

Use FALSE when you mean FALSE.  Don't use F.  It causes trouble.

(Note:  You *cannot* have spurious objects name "FALSE" (and not equal
to FALSE) hanging around; R won't let you.  That's why you use FALSE and
not F.)

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list