Compute the Exponential minus 1 of a Number in R Programming – expm1() Function

expm1() function in R Language is used to compute exponential minus 1 i.e, exp()-1.

Syntax: expm1(x)

Parameters:
a, b: number or number vector

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate
# expm1 function
  
# Calling the expm1() function
expm1(4# e5 -1 
expm1(10)
expm1(15)

chevron_right


Output:

[1] 53.59815
[1] 22025.47
[1] 3269016

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate
# expm1 function
  
# Calling the expm1() function
expm1(rep(1:5))
expm1(rep(5:8))

chevron_right


Output:

[1]  1.718282   6.389056  19.085537  53.598150 147.413159
[1]  147.4132  402.4288 1095.6332 2979.9580
My Personal Notes arrow_drop_up

Recommended Posts:


Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.