How to Compute Euler’s Number in R (Example)
In this article, I’ll illustrate how to get Euler’s number’ in the R programming language.
The tutorial consists of this content:
Let’s dive into it.
Example: Computing Euler’s Number (e) in R
The following code illustrates how to get Euler’s number (e) using the exp() function provided by the basic installation of the R programming language.
exp(1) # Euler's number (e) # 2.718282
We can also use the exp command to compute e^2 by simply inserting a 2 within the exp function:
exp(2) # Euler's number to the power of 2 (e^2) # 7.389056
The previous R codes can be used to return Euler’s number, because the exp function computes the exponentiation with base e.
Video & Further Resources
Would you like to learn more about the computation of Euler’s number in R’? Then you may want to have a look at the following video instruction of my YouTube channel. In the video instruction, I illustrate the R codes of this tutorial in a live programming session.
The YouTube video will be added soon.
Furthermore, you may want to read some of the other tutorials on statisticsglobe.com. I have published numerous tutorials already:
In summary: In this tutorial, I explained how to calculate Euler’s number’ in the R programming language. Let me know in the comments, in case you have additional questions and/or comments.