logmean | R Documentation |
Calculates the logarithmic mean of two numbers.
logmean(a, b, base = exp(1))
a |
the first operand (must be non-negative) |
b |
the second operand (must be non-negative) |
base |
the base of the logarithm used in this calculation.
(Default is |
This is an internal helper function for logarithmicmean_byname
.
0
if a = 0
or b = 0
; x1
if a == b
; and
(a - b) / log(a/b, base = base)
for all other values of a
and b
matsbyname:::logmean(0, 0) # 0
matsbyname:::logmean(0, 1) # 0
matsbyname:::logmean(1, 0) # 0
matsbyname:::logmean(1, 1) # 1
matsbyname:::logmean(2, 1)
matsbyname:::logmean(1, 2) # commutative
matsbyname:::logmean(1, 10) # base = exp(1), the default
matsbyname:::logmean(1, 10, base = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.