Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anything wrong with using T & F instead of TRUE & FALSE?

Tags:

I noticed that using T and F instead of TRUE and FALSE in functions in R gives me the same results. Of course, T and F are more concise, yet, I see TRUE and FALSE being used more often.

I was wondering whether there is any difference between the two? Is there anything wrong with using T and F?

like image 788
Rob Avatar asked Aug 15 '13 15:08

Rob


People also ask

Is there anything wrong meaning?

In your examples, "Is there something wrong" probably implies you feel something might be wrong and want to confirm with others while "Is there anything wrong" is just a general inquiry whether anything is wrong at all.

What's wrong in vs with?

"In" denotes that the item in question is in some way contained. "What's wrong with something" may be used for a group, but may also be used for an individual item—"What's wrong with Paul?"

Did I say something wrong meaning?

Did I say something mean? It can also mean: did I make a mistake? (For example: did I make any grammar mistakes?)

Did I do something wrong or did something wrong?

The correct phrase is Did I do something wrong? This past form is made up of Did + <pronoun> + <base form of the verb>. Example: Did you put the cat out last night? (old form of English: Put you the cat ...?) In your example it is the past tense of do.


1 Answers

T and F can be re-defined, but TRUE and FALSE are reserved words and cannot be re-defined.

> TRUE <- 1L Error in TRUE <- 1L : invalid (do_set) left-hand side to assignment > FALSE <- 0L Error in FALSE <- 0L : invalid (do_set) left-hand side to assignment > T <- F  # yikes, this would be hard to debug! 

Personally, I sometimes use T and F when I use R interactively, but I never use them in production code or packages.

like image 109
Joshua Ulrich Avatar answered Oct 28 '22 16:10

Joshua Ulrich