In R, log is the natural logarithm. In calculators, log usually means base 10 logarithm. To achieve that in R you can use the log10 function.

Copylog(5)
## [1] 1.609438
log10(5)
## [1] 0.69897

As for your formula, it seems correct, since log is the natural logarithm.

Answer from alko989 on Stack Overflow
🌐
RDocumentation
rdocumentation.org › packages › base › versions › 3.6.2 › topics › log
log: Logarithms and Exponentials
a positive or complex number: the base with respect to which logarithms are computed. Defaults to \(e\)=exp(1). A vector of the same length as x containing the transformed values. log(0) gives -Inf, and log(x) for negative values of x is NaN.
🌐
YouTube
youtube.com › watch
Logarithm (log), Exponentiation (exp) and e in R - YouTube
Relation between log and exp in R and how to make your own e in R
Published   May 15, 2021
🌐
Educative
educative.io › answers › what-is-the-log-function-in-r
What is the log() function in R?
The log() function in R is used to obtain the logarithm (the natural logarithm, by default) of a given input numeric or complex vector.
🌐
Medium
medium.com › @michael71314 › r-lesson-30-logarithms-5b72b818d3d3
R Lesson 30: Logarithms | by Michael Orozco-Fletcher | Medium
July 7, 2023 - Calculating logs in R is as simple as using R’s built-in log() function and adding in two parameters-the argument and the base. With these two parameters and the log() function, R will return the logarithm's exponent, which in this case is 5 since log base-2 of 32 equals 5.
🌐
EndMemo
endmemo.com › r › log.php
R log (ln) Function Examples -- EndMemo
log() by default computes the natural logarithms (Ln, with base e): >log(5) #ln5 · [1] 1.609438 > log(13.27) #ln(13.27) [1] 2.585506 · The · base=x parameter specifies the calculation of the logarithms with base x: >log(9,base=3) #log39 = 2 · >log10(5) #lg5 · [1] 0.69897 · >log2(5) #log25 · [1] 2.321928 · [1] 2 · Let's try vector: >x <- rep(1:12) >x ·
🌐
RCODER
r-coder.com › home › r introduction › logarithm and exponential in r
Logarithm and exponential in R [exp(), log(), log10(), log2() ...
December 30, 2023 - Logarithms and exponential can ... and 10 logarithms, respectively, log1p to compute log(1 + x) and the exp function to compute the exponential function and expm1 to calculate exp(x) - 1. The basic R function to compute logarithms ...
🌐
Statology
statology.org › home › how to calculate log in r (with examples)
How to Calculate Log in R (With Examples)
June 18, 2021 - You can use the log() function in R to calculate the log of some value with a specified base: ... If you don’t specify a base, R will use the default base value of e.
Find elsewhere
🌐
UCLA
math.ucla.edu › ~anderson › rw1001 › library › base › html › Log.html
R: Logarithms and Exponentials
log computes natural logarithms, ... (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base (log10 and log2 are only special cases). log1p(x) computes log(1+x) accurately also for |x| << 1 (and less accurately when x ~= -1). ... A vector of the same length ...
🌐
GeeksforGeeks
geeksforgeeks.org › performing-logarithmic-computations-in-r-programming-log-log10-log1p-and-log2-functions
Performing Logarithmic Computations in R Programming - log(), log10(), log1p(), and log2() Functions - GeeksforGeeks
June 5, 2020 - Syntax: log(x) Parameter: x: Specified value. Returns: It returns the natural logarithm of the specified value, infinity for 0 and NaN for the negative value. Example 1:
🌐
Statistics Globe
statisticsglobe.com › home › learn r programming (tutorial & examples) | free introduction › log function in r (5 examples) | natural, binary & common logarithm
log Function in R (5 Examples) | Natural, Binary & Common Logarithm
March 17, 2022 - In Example 2, I’ll show how to change the base of the log command. For this task, we need to specify the base argument of the log function as shown below: ... You can see the logarithm of 3 with a base of 5 in the output above. The R programming language provides some wrapper functions for common types of logarithms.
🌐
SQLPad
sqlpad.io › tutorial › calculate-logarithm
How to Calculate Logarithm in R | SQLPad
May 7, 2024 - Step-by-step guide on calculating logarithms in R. Detailed exploration of R's log() function and its parameters.
🌐
R-Lang
r-lang.com › home › calculating natural log using log() function in r
Calculating Natural Log using log() Function in R - R-Lang
December 3, 2024 - The natural log uses “e” as its base, whereas log10 uses 10. The “e” is Euler’s number, whose value is approximately 2.718. In R, the formula for the natural log is ln(x) = loge(x), where e is the base.
🌐
DataScience Made Simple
datasciencemadesimple.com › home › log function in r – log(),log2(),log10()
Log function in R - log(),log2(),log10() - DataScience Made Simple
July 3, 2020 - Log function in R –log() computes the natural logarithms (Ln) for a number or vector. Apart from log() function, R also has log10 and log2 functions...
🌐
YouTube
youtube.com › watch
log Function in R (5 Examples) | How to Calculate Natural, Binary & Common Logarithm | Change Base - YouTube
How to compute logarithms using the log function in the R programming language. More details: https://statisticsglobe.com/log-function-in-r/R code of this vi...
Published   December 28, 2021
🌐
Psu
astrostatistics.psu.edu › su07 › R › html › base › html › Log.html
R: Logarithms and Exponentials
log10 and log2 are only special cases, but will be computed more efficiently and accurately where supported by the OS. A vector of the same length as x containing the transformed values. log(0) gives -Inf (when available). ... R, but logb is preferred if base is specified, for S-PLUS compatibility.
🌐
GeeksforGeeks
geeksforgeeks.org › logarithmic-and-power-functions-in-r-programming
Logarithmic and Power Functions in R Programming - GeeksforGeeks
June 1, 2020 - It is the inverse of the exponential function, where it represents the quantity that is the power to the fixed number(base) raised to give the given number. It returns the double value. Formula: ... if 100 = 102 then log10100 = 2 List of various log() functions: The number is numeric or complex vector and the base is a positive or complex vector with the default value set to exp(1).