HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
In R, you can use operators to perform common mathematical operations on numbers
In R, you can use operators to perform common mathematical operations on numbers.
The +
operator is used to add together two values:
10 + 5
And the -
operator is used for subtraction:
10 - 5
You will learn more about available operators in our R Operators Tutorial.
R also has many built-in math functions that allows you to perform mathematical tasks on numbers.
For example, the min()
and max()
functions can be used to find the lowest or highest
number in a set:
max(5, 10, 15)
min(5, 10, 15)
The sqrt()
function returns the square root of
a number:
sqrt(16)
The abs()
function returns the absolute (positive) value of
a number:
abs(-4.7)
The ceiling()
function rounds a number upwards to
its nearest integer, and the floor()
function rounds a number downwards to its nearest integer, and returns the result:
ceiling(1.4)
floor(1.4)