डाउनलोड पी.डी.एफ. ई-बुक्स
R - Logical Data Type

R Language में दो operands में जब comparison किया जाता है तब Logical values create हो जाती है | For Example, TRUE and FALSE


Example for Logical Data Type in R

Source Code :
> var1 = 5
> var2 = 5
> var1 == var2
[1] TRUE
> var1 < var2
[1] FALSE

Create Logical Values using Logical Operators

> 10 == 20 & 10 == 20 
[1] FALSE
> 10 != 20 & 10 == 10 
[1] TRUE
> 10 < 20 & 10 > 10 
[1] FALSE
> 10 < 20 & 10 == 10 
[1] TRUE
> 10 < 20 | 10 < 10 
[1] TRUE
> 10 > 20 | 10 < 10 
[1] FALSE
> !10 > 20
[1] TRUE
> !10 < 20
[1] FALSE