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.
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.
ETH Zurich
stat.ethz.ch › R-manual › R-devel › library › base › help › log.html
R: Logarithms and Exponentials
Index of /R-manual/R-devel/library/base
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.
Top answer 1 of 3
44
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.
2 of 3
4
In addition I will point out that your model
Copyy ~ a + b*(x/305) + c*((x/305)^2) + d*log(305/x) + f*(log(305/x))^2
is linear in the statistical sense of being linear in the coefficients; it doesn't need to be linear in x.
You don't need nls to fit this model, you could use lm().
But remember to look at the I() function to express terms like (x/305)^2.
ETA example:
CopyaDF <- data.frame(x=abs(rnorm(100)), y=rnorm(100))
lm(y ~ 1 + I(x/305) + I((x/305)^2) + log(305/x) + I(log(305/x)^2), data=aDF)
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 ·
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 ...
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.
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).