Please enable JavaScript.
Coggle requires JavaScript to display documents.
Unit-2: Types of Operators (Arithmetic Operators (+ (Adds two vectors,…
Unit-2: Types of Operators
Arithmetic Operators
Arithmetic Operators
+
Adds two vectors
print(v+t)
-
Subtracts second vector from the first
print(v-t)
*
Multiplies both vectors
print(v*t)
/
Divide the first vector with the second
print(v/t)
%%
Give the remainder of the first vector with the second
print(v%%t)
%/%
The result of division of first vector with second (quotient)
print(v%/%t)
^
The first vector raised to the exponent of second vector
print(v^t)
Logical Operators
&
element-wise logical AND operator
print(v&t)
|
element-wise logical OR operator
print(v|t)
!
Logical NOT operator
print(!v)
&&
Local AND operator.
print(v&&t)
||
Logical OR operator
print(v||t)
Relational Operators
Logical Operators
Assignment Operators
Left Assignment operators
<- or = or <<-
Right Assignment operators
-> or ->>
Relational Operators
greater than >
print(v>t)
==
print(v==t)
less than <
print(v < t)
<=
print(v<=t)
greaterthanequalto >=
print(v>=t)
!=
print(v!=t)
Assignment Operators
Miscellaneous Operators
Miscellaneous Operators
: It creates the series of numbers in sequence for a vector
v <- 2:8 ; print(v)
%in%
used to identify if an element belongs to a vector
v1 <- 8; v2 <- 12; t <- 1:10; print(v1 %in% t)
%*%
M = matrix( c(2,6,5,1,10,4), nrow=2, ncol=3, byrow=TRUE)
t = M %*% t(M)
print(t)
v <- c( 2,5.5,6)
t <- c(8, 3, 4)
Mind Map Prepared by - Srinivas Adapa Associate Professor, CSE Department, CITM