R comes with a whole set of Mathematical Functions. Here are some useful math functions:
Seq
|
Function
|
Description
|
1
|
abs(x)
|
Calculates the absolute value of x
|
2
|
sum()
|
Calculate the sum of all the values in a data structure
|
3
|
mean()
|
Calculate the arithmetic mean of all the values
|
4
|
round()
|
Round the values to 0 decimal places by default
|
5
|
sqrt(x)
|
Calculates the Principal Square Root of x
|
6
|
ceiling(x)
|
Rounds to the nearest integer that’s larger than x
|
7
|
floor(x)
|
Rounds to the nearest integer that’s smaller than x
|
8
|
trunc()
|
Truncates the decimal part
|
9
|
exp(x)
|
Calculates the Expenential of x
|
10
|
log()
|
Calculates the Natural Logarithm
|
These functions are broadly using while doing data analysis. So, let’s keep them safe at a single repository.
Thank You!