How to create variable in R In R we have to give a name to the varible followed by <- sign() then we have to assign something to this variable it may be number,array,matrix,vector, or any data.frame like var1 <- 12 and we must have to run it otherwise it gives error var1 not present. so don’t forget to run the code now we create another variable and assign a number to it. var2 <- 20 operators in R we can perform different operations on it(variables) by using some operators here we are using arithmetic operators to do calculations on these two variables. and assigning this operation to the third variable called ‘var3’. var3 <- var1+var2 now let’s see the result of this operation by just typing the variable name var3 it gives, [1] 32