Operator The
operator is a symbol that tells the compiler to perform specific mathematical or logical operations. The R language has a rich set of builtin operators and provides the following types of operators.
1, the type of operator
R has the following operator types:
 Arithmetic operator
 Relational operator
 逻辑操作符
 Assignment Operator
 Other Operators
2, Arithmetic Operators
The following table shows the arithmetic operators supported by the R language. The operator works for each element of the vector.
操作符  描述  example 

+  Two vectors add 
It produces the following result 

  Two vectors subtracted 
it produces the following Result 

*  Two vector multiplication 
It produces the following result 

/  divides the first vector by the second vector 
When we execute the above code, it produces the following Result 

%%  两 vector求余 
It produces the following result 

％/％  Two vectors are divided by the business 
It produces the following result 

^  The second vector is the first The index of a vector 
produces the following result 

3, relational operator
The following table shows the relational operators supported by the R language. Each element of the first vector is compared to a corresponding element of the second vector. The result of the comparison is a Boolean value.
操作符  描述  example 

>  Check if each element of the first vector is greater than the corresponding element of the second vector. 
It produces the following result 

<  Checks if each element of the first vector is smaller than the corresponding element of the second vector. 
It produces the following result 

==  Checks if each element of the first vector is equal to the corresponding element of the second vector. 
It produces the following result 

<=  Checks if each element of the first vector is less than or equal to the corresponding element of the second vector. 
It produces the following result 

> =  Checks if each element of the first vector is greater than or equal to the corresponding element of the second vector. 
It produces the following result 

!=  Checks if each element of the first vector is not equal to the corresponding element of the second vector. 
It produces the following result 

4, logical operator
The following table shows the logical operators supported by the R language. It only works with logic, numbers or complex types of vectors. All numbers greater than 1 are considered to be logical values TRUE. Each element of the first vector is compared to a corresponding element of the second vector. The result of the comparison is a Boolean value.
操作符  描述  example 

&  It is called the elemental logical AND operator. It combines each element of the first vector with the corresponding element of the second vector, and gives an output TRUE if both elements are TRUE. 
It produces the following result 

  It is called element logic or operator. It combines each element of the first vector with the corresponding element of the second vector, and gives an output TRUE if the element is true. 
It produces the following result 

!  It is called a logical nonoperator. Get each element of the vector and give the opposite logical value. 
It produces the following result 

Logical operators && and  only consider the first element of the vector, giving the vector of the individual element as the output.
操作符  描述  example 

&&  is called the logical AND operator. TRUE is given when the first element of two vectors is taken and only two are TRUE. 
It produces the following result 

  is called the logical OR operator. Take the first element of two vectors, or TRUE if one of them is TRUE. 
It produces the following result 

5, assignment operator
These operators are used to assign values to vectors.
操作符  描述  example 

<− or = or <<− 
称左分配 
It produces the following result 

> or >> 
called right allocation 

6, other operators
These operators are used for specific purposes, not general mathematical or logical calculations.
操作符  描述  example 

:  冒号 Operator. It creates a series of numbers in order for the vector. 
It produces the following result 

%in%  This operator is used to identify whether an element belongs to a vector. 
It produces the following result 

%*%  This operator is used to multiply the matrix by its transpose. 
It produces the following results 
