As part of series Learn Data analytics using R lets understand basic syntax in this post.
Numeric Data Type
Lets say you want to create two variable A and B. In R program you shall assign a value to the variable using
<- . Now, if you want to assign 25 to A and 29 to B. You can use the following code.
You can add both variable by simply using + operator
> A+B  54
Character Data Type
The above example is for assigning numeric value. If you need to assign a character/word to the variable you can do so by adding a quotations
Now, Variable A is assigned with a text value of “Arsenal”. Character and Numeric are data types.
Logical Data Type
R is also capable of storing Logical data type like TRUE/FALSE
C<-is.numeric(B) > C  TRUE
Finding a data type
You can use
class() to find the data type of a variable
class(A)  "character" > class(B)  "numeric" > class(C)  "logical"