ln(SciViews)
ln()所属R语言包:SciViews
Logarithms
对数
译者:生物统计家园网 机器人LoveR
描述----------Description----------
To avoid confusion using the default log() function, which is natural logarithm, but spells out like base 10 logarithm in the mind of some beginneRs, we define ln() and ln1p() as wrappers for log() with default base = exp(1) argument and for log1p(), respectively. For similar reasons, lg() is a wrapper of log10() (there is no possible confusion here, but 'lg' is another common notation for base 10 logarithm). lg1p() is a convenient way to use the optimized code to calculate the logarithm of x + 1, but returning the result in base 10 logarithm. e is the euler constant and is provided for convenience as exp(1). Finally lb() is a synonym of log2().
为了避免混淆使用的默认log()功能,这是自然对数,但阐明了像以10为底的一些初学者在脑海中,我们定义ln()和ln1p()<包装X>默认log()参数和base = exp(1),。出于同样的原因,log1p()是一个包装lg()(有没有可能出现的混乱,但以10为底的“LG”,是另一种常见的符号)。 log10()是一个方便的方式来使用优化代码来计算x + 1的数,但返回的结果在10为底的对数。 lg1p()是欧拉常数,并提供了方便e。最后exp(1)是的lb()的代名词。
用法----------Usage----------
ln(x)
ln1p(x)
lg(x)
lg1p(x)
e
lb(x)
参数----------Arguments----------
参数:x
a numeric or complex vector.
一个数字或复杂的向量。
值----------Value----------
A vector of the same length as x containing the transformed values. ln(0) gives -Inf, and negative values give NaN.
x包含转换后的值的长度相同的向量。 ln(0)给-Inf,负值NaN。
(作者)----------Author(s)----------
Philippe Grosjean <phgrosjean@sciviews.org>, but these are just convenient
wrappers around standard R logarithm functions in the base package.
参见----------See Also----------
log
log
实例----------Examples----------
ln(exp(3)) # Same as log(exp(3))[同为log((3))]
ln1p(c(0, 1, 10, 100)) # Wrapper for log1p()[包装log1p()]
lg(10^3) # Same as log10(10^3)[同LOG10(10 ^ 3)]
lg1p(c(0, 1, 10, 100)) # log10(x + 1), but optimized for x << 1[log10(x + 1的),但对于x << 1优化]
e^4 # Similar to exp(4), but different calculation![相似于exp(4),但不同的计算!]
## Note: exp(4) is to be preferred to e^4, if possible![#注:EXP(4)是首选E ^ 4,如果可能的话!]
lb(1:3) # Wrapper for log2()[包装的log2()]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|