0% found this document useful (0 votes)
19 views

For Integer You Need To Add L

The document discusses logical operators in R programming including logical not, element-wise logical AND, logical AND, and data types like integer, complex, logical and character. It provides examples of using operators like %in% and converting between data types using functions like as.integer() and class().

Uploaded by

Halima Lari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

For Integer You Need To Add L

The document discusses logical operators in R programming including logical not, element-wise logical AND, logical AND, and data types like integer, complex, logical and character. It provides examples of using operators like %in% and converting between data types using functions like as.integer() and class().

Uploaded by

Halima Lari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

BA NOTES

LOGICAL OPERATORS

1. Logical Not

In R programming 0= false and other numbers= true. Logical not displays the result in the opposite
manner.

2. Element wise logical AND

This takes into consideration for both variables and if any one value of one variable is 0 it displays as
False.

3. Logical And

It takes into consideration of only first value of both the variables.

<- , =, <<- : All these three means equals to

Now TRUE= 1

FALSE= 0

Now if a=2 and var includes 3,4,5,6,7,8,9,10

Then a%in%var will be false as 2 is not included in var

For integer you need to add L

To check its class= class(x)

To find if its integer or not= is.integer(x)

To convert into integer: x=as.integer(54) then output will be 54L

For complex you need to have I

X= 5+4i

For Logical you need to have the ouput as TRUE or FALSE

If x=1 and y=2 and z=x>y which is False then z is Logical

For Character you need to have the output in double quotes

For example “7.8” will be considered as character


26th April extra class: 13:49

29th April extra class: 12:56

You might also like