设为首页收藏本站获取积分奖励

R语言中文网

 找回密码
 立即注册
查看: 699|回复: 0

R语言测试两个对象是否(几乎)相等all.equal()函数-中英文对照帮助文档

[复制链接]
发表于 2020-8-20 22:40:44 | 显示全部楼层 |阅读模式
        R语言测试两个对象是否(几乎)相等all.equal()函数-中英文对照帮助文档

                                         By MicroRbt Martinez PhD

R语言函数名:all.equal()
R语言函数功能:测试两个对象是否(几乎)相等
来自资源库:基础库(R语言自带)
all.equal()函数所属R语言包:所在R包具体名称、包功能的中英文双语描述见正文后面'--所在R语言包信息--'部分。

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

all.equal(x, y) is a utility to compare R objects x and y testing near equality . If they are different, comparison is still made to some extent, and a report of the differences is returned. Do not use all.equal directly in if expressions—either use isTRUE(all.equal(....)) or identical if appropriate.
all.equal(x, y)是用于比较R对象x和y测试near equality的实用程序。如果它们不同,则仍会在一定程度上进行比较,并返回差异报告。不要在if表达式中直接使用all.equal;如果合适,请使用isTRUE(all.equal(....))或identical。


使用方法-----Usage-----

all.equal(target, current, ...)
## S3 method for class 'numeric' S3 method for class 'numeric'
all.equal(target, current,
tolerance = sqrt(.Machine$double.eps), scale = NULL,
countEQ = FALSE,
formatFUN = function(err, what) format(err),
..., check.attributes = TRUE)
## S3 method for class 'list' S3 method for class 'list'
all.equal(target, current, ...,
check.attributes = TRUE, use.names = TRUE)
## S3 method for class 'environment' S3 method for class 'environment'
all.equal(target, current, all.names=TRUE, ...)
## S3 method for class 'POSIXt' S3 method for class 'POSIXt'
all.equal(target, current, ..., tolerance = 1e-3, scale)
attr.all.equal(target, current, ...,
check.attributes = TRUE, check.names = TRUE)

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

参数target介绍: R object.
R对象。

参数current介绍: other R object, to be compared with target.
其他R对象,与target比较。

参数...介绍: further arguments for different methods, notably the following two, for numerical comparison:
用于数值比较的不同方法(尤其是以下两个方法)的其他参数:

参数tolerance介绍: numeric ≥ 0. Differences smaller than tolerance are not reported. The default value is close to 1.5e-8.
数值??0。不报告小于tolerance的差异。默认值接近1.5e-8。

参数scale介绍: NULL or numeric > 0, typically of length 1 or length(target). See Details .
NULL或数字> 0,通常长度为1或length(target)c。请参阅Details。

参数countEQ介绍: logical indicating if the target == current cases should be counted when computing the mean (absolute or relative) differences. The default, FALSE may seem misleading in cases where target and current only differ in a few places; see the extensive example.
逻辑指示在计算平均(绝对或相对)差异时是否应计算target == current个案例。在target和current仅在几个地方有所不同的情况下,默认值FALSE可能会产生误导。请参阅广泛的示例。

参数formatFUN介绍: a function of two arguments, err, the relative, absolute or scaled error, and what, a character string indicating the kind of
-----未完,待续-----,↓↓↓展开剩余72%↓↓↓
购买主题 前行需要您的支持,请赞助作者 【15 金钱】 就能浏览全部100%内容啦!(本贴一次赞助、永久可读)
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Archiver|R语言中文网    

GMT+8, 2024-5-21 02:25 , Processed in 0.030766 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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