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

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

[复制链接]
发表于 2012-2-16 21:07:22 | 显示全部楼层 |阅读模式
is.finite(base)
is.finite()所属R语言包:base

                                        Finite, Infinite and NaN Numbers
                                         有限,无穷大和NaN的数

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

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

is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or infinite.
is.finite和is.infinite返回一个相同长度的向量x,说明哪些元素是有限的(不是无限的,且没有遗漏)或无限。

Inf and -Inf are positive and negative infinity whereas NaN means "Not a Number".  (These apply to numeric values and real and imaginary parts of complex values but not to values of integer vectors.)  Inf and NaN are reserved words in the R language.
Inf和-Inf是正无穷和负无穷而NaN的意思是“不是一个数”。 (这些适用于数值和复杂值的实部和虚部分,但不是整数向量的值。)Inf和NaN保留在R语言文字。


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


is.finite(x)
is.infinite(x)
Inf
NaN
is.nan(x)



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

参数:x
R object to be tested: the default methods handle atomic vectors.
R对象进行测试:默认的方法处理原子的向量。


Details

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

is.finite returns a vector of the same length as x the jth element of which is TRUE if x[j] is finite (i.e., it is not one of the values NA, NaN, Inf or -Inf) and FALSE otherwise.  Complex numbers are finite if both the real and imaginary parts are.
is.finite返回一个长度相同的向量xj个元素,其中TRUE如果x[j]是有限的(即,它是不是值<X >,NA,NaN或Inf)-Inf否则。复数是有限的,如果是实部和虚部分。

is.infinite returns a vector of the same length as x the jth element of which is TRUE if x[j] is infinite (i.e., equal to one of Inf or -Inf) and FALSE otherwise.  This will be false unless x is numeric or complex. Complex numbers are infinite if either the real or the imaginary part is.
is.infinite返回一个长度相同的向量xj个元素,其中TRUE如果x[j]是无限的(即等于一个Inf -Inf)FALSE否则。这将是虚假的,除非x是数字或复杂。复数是无限的,如果真实或假想的一部分。

is.nan tests if a numeric value is NaN.  Do not test equality to NaN, or even use identical, since systems typically have many different NaN values.  One of these is used for the numeric missing value NA, and is.nan is false for that value.  A complex number is regarded as NaN if either the real or imaginary part is NaN but not NA. All elements of logical, integer and raw vectors are considered not to be NaN.
is.nan测试,如果一个数值是NaN。不要测试平等NaN,甚至是使用identical,因为系统通常有许多不同的NaN值。其中之一是用于数字缺失值NA,is.nan是该值的虚假。一个复杂的数量被视为NaN如果真实或虚构的部分是NaN而不是NA。逻辑,整数和原始向量的所有元素被认为是不为NaN。

All three functions accept NULL as input and return a length zero result. The default methods accept character and raw vectors, and return FALSE for all entries. Prior to R version 2.14.0 they accepted all input, returning FALSE for most non-numeric values; cases which are not atomic vectors are now signalled as errors.
所有三种功能接受NULL作为输入,并返回一个长度为零的结果。默认的方法接受字符和原始向量,回报FALSE的所有条目。 R版本2.14.0之前,他们接受所有输入,返回FALSE对于大多数非数字值是不是原子的向量的情况下,现在的错误信号。

All three functions are generic: you can write methods to handle specific classes of objects, see InternalMethods.
所有这三项功能是通用的:你可以写的方法来处理特定的类的对象,看到InternalMethods。


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

A logical vector of the same length as x: dim, dimnames and names attributes are preserved.
一个逻辑向量相同长度的x:dim,dimnames和names属性会被保留。


注意----------Note----------

In R, basically all mathematical functions (including basic Arithmetic), are supposed to work properly with +/- Inf and NaN as input or output.
在R,基本上所有的数学函数(包括基本Arithmetic),都应该正确工作+/- Inf和NaN为输入或输出。

The basic rule should be that calls and relations with Infs really are statements with a proper mathematical limit.
基本规则应该以Inf电话和关系真的是一个适当的数学限制的声明。

Computations involving NaN will return NaN or perhaps NA: which of those two is not guaranteed and may depend on the R platform (since compilers may re-order computations).
计算涉及NaN将返回NaN或者NA:这两个不能保证和可依赖的R平台(因为编译器可能会重新整理计算)。


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

ANSI/IEEE 754 Floating-Point Standard.

about Floating-Point Arithmetic  ACM Computing Surveys, 23(1).<br> Postscript version available at http://www.validlab.com/goldberg/paper.ps Extended PDF version at http://www.validlab.com/goldberg/paper.pdf


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

NA, "Not Available" which is not a number as well, however usually used for missing values and applies to many modes, not just numeric and complex.
NA,无,这不是一个数量以及通常用于缺失值,适用于多种模式,不只是数字和复杂的。

Arithmetic, double.
Arithmetic,double。


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


pi / 0 ## = Inf a non-zero number divided by zero creates infinity[#= INF一个非零的数除以零创建无穷]
0 / 0  ## =  NaN[#=南]

1/0 + 1/0 # Inf[INF]
1/0 - 1/0 # NaN[为NaN]

stopifnot(
    1/0 == Inf,
    1/Inf == 0
)
sin(Inf)
cos(Inf)
tan(Inf)

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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