The R language is very powerful and can be used to calculate various types of exponential functions.
For example, suppose Y=a^x, seeking x.
Function:
Log (P1 [, p2])
Where P1 is the power, P2 is the base, if P2 does not exist, then the base is E, the result is exponential.
Note: Here the e is a mathematical constant, is the base of the natural logarithm, approximately equal to 2.718281828, also known as Euler number.
1. Natural logarithm (base e logarithm)
Input: x<-exp (1)
Log (x)
Or
Input: Log (exp (1))
Output: 1
Input: Log (10)
Output: 2.302585
Description: Calculates an e-base
2. Logarithm with 10 base
Input: Log (100^2,100)
Output: 2
The first argument is a power, and the 2nd argument is the base.
3. Logarithm with 2 base
Input: Log (2^10, 2)
Output: 10
4. Logarithm with 3 base
Input: Log (3^10, 3)
Output: 10
5. Logarithm with any real number as the base
Input: Log ((2.5) ^8,2.5)
Output: 8
R-Language logarithm function (known base and power, exponential)