exp() function in R is a very useful function for math and statistical analysis. It is used to calculate the exponential value of a number. The exp() function can also be used as an abbreviation for the word “exponential.” This function computes “e” raised to the power of “n”. Generally, it is used to compute exponential growth or decay rates. It is also used to calculate interest rates or find out how much money will be earned after a certain period of time. It can be used for both positive and negative values.
Syntax
The exp() function takes a value and raises it to the power of e.
exp(n)
Argument
- n = an integer
Example
exp(1)
exp(1.5)
exp(-2)
Output
[1] 2.718282
[1] 4.481689
[1] 0.1353353