找回密码
 注册
查看: 9924|回复: 0

R语言:Log()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:51:56 | 显示全部楼层 |阅读模式
Log(base)
Log()所属R语言包:base

                                        Logarithms and Exponentials
                                         对数和幂

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

log computes logarithms, by default natural logarithms,  log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base.
log计算对数,默认情况下,自然对数,log10计算常见的(即以10为基数)的对数,log2计算二进制(即基地2)对数。一般形式的log(x, base)计算对数与基地base。

log1p(x) computes log(1+x) accurately also for |x| << 1 (and less accurately when x is approximately -1).
log1p(x)计算log(1+x)准确|x| << 1(不太准确时x is approximately -1)。

exp computes the exponential function.
exp计算指数函数。

expm1(x) computes exp(x) - 1 accurately also for |x| << 1.
expm1(x)计算exp(x) - 1准确|x| << 1。


用法----------Usage----------


log(x, base = exp(1))
logb(x, base = exp(1))
log10(x)
log2(x)

log1p(x)

exp(x)
expm1(x)



参数----------Arguments----------

参数:x
a numeric or complex vector.
一个数字或复杂的矢量。


参数:base
a positive or complex number: the base with respect to which logarithms are computed.  Defaults to e=exp(1).
一个正数或复数:对数计算的基础。默认为e=exp(1)。


Details

详情----------Details----------

All except logb are generic functions: methods can be defined for them individually or via the Math group generic.
除了logb是通用的功能:可以定义为他们单独或通过Math组通用方法。

log10 and log2 are only convenience wrappers, but logs to bases 10 and 2 (whether computed via log or the wrappers) will be computed more efficiently and accurately where supported by the OS. Methods can be set for them individually (and otherwise methods for log will be used).
log10和log2只是方便的包装,但10和2个基地(无论是通过log或包装计算)的日志,将更有效率和更准确地计算操作系统的支持。方法可以单独为他们(和其他log将使用的方法)。

logb is a wrapper for log for compatibility with S.  If (S3 or S4) methods are set for log they will be dispatched. Do not set S4 methods on logb itself.
logb是log如果相容性与S(S3或S4)方法log“他们将派出的包装。不要设置logb本身S4方法。

All except log are primitive functions.
所有除了log是原始的功能,。


值----------Value----------

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.  exp(-Inf) is 0.
x包含转换值的长度相同的向量。 log(0)给-Inf,log(x)为负值x是NaN。 exp(-Inf)是0。

For complex inputs to the log functions, the value is a complex number with imaginary part in the range [-pi, pi]: which end of the range is used might be platform-specific.
对于复杂的输入到日志功能,价值是与虚部的复数范围[-pi, pi]:使用范围的结束,可能是特定于平台的。


S4方法----------S4 methods----------

exp, expm1, log, log10, log2 and log1p are S4 generic and are members of the Math group generic.
exp,expm1,log,log10,log2和log1pS4通用Math通用组成员。

Note that this means that the S4 generic for log has a signature with only one argument, x, but that base can be passed to methods (but will not be used for method selection).  On the other hand, if you only set a method for the Math group generic then base argument of log will be ignored for your class.
请注意,这意味着通用的,S4log有一个签名,只有一个参数x,但base可以传递给方法(但不会使用方法的选择) 。另一方面,如果你只设置一个方法Math组通用然后baselog参数将被忽略你的类。


源----------Source----------

log1p and expm1 may be taken from the operating system, but if not available there are based on the Fortran subroutine dlnrel by W. Fullerton of Los Alamos Scientific Laboratory (see http://www.netlib.org/slatec/fnlib/dlnrel.f and (for small x) a single Newton step for the solution of log1p(y) = x respectively.
log1p和expm1可以从操作系统,但如果不提供有基于Fortran子程序dlnrel W·富勒顿的洛斯阿拉莫斯科学实验室(请参阅http:// www.netlib.org / slatec / fnlib / dlnrel.f(小X)一个单一的牛顿log1p(y) = x分别解决方案的第一步。


参考文献----------References----------

The New S Language. Wadsworth &amp; Brooks/Cole. (for <code>log</code>, <code>log10</code> and <code>exp</code>.)
Programming with Data.  A Guide to the S Language. Springer. (for <code>logb</code>.)

参见----------See Also----------

Trig, sqrt, Arithmetic.
Trig,sqrt,Arithmetic。


举例----------Examples----------


log(exp(3))
log10(1e7)# = 7[= 7]

x <- 10^-(1+2*1:9)
cbind(x, log(1+x), log1p(x), exp(x)-1, expm1(x))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 05:28 , Processed in 0.030855 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表