Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

testEqual

Compare Two Objects


Description

Generic function to compare two objects. The methods return a logical value, TRUE if the objects are the same type and value and FALSE otherwise. The default compares array values but not attributes or class. Some descriptive information in the objects may be ignored.

Usage

testEqual(obj1, obj2, fuzz = 0)
    ## Default S3 method:
testEqual(obj1, obj2, fuzz = 1e-16)
    ## S3 method for class 'array'
testEqual(obj1, obj2, fuzz = 1e-16)
    ## S3 method for class 'list'
testEqual(obj1, obj2, fuzz = 1e-16)
    ## S3 method for class 'matrix'
testEqual(obj1, obj2, fuzz = 1e-16)
    ## S3 method for class 'numeric'
testEqual(obj1, obj2, fuzz = 1e-16)

Arguments

obj1, obj2

Objects of the same class.

fuzz

Differences less than fuzz are ignored.

Details

The functions for comparing numeric values used in the default method for this generic replacement.

Value

TRUE or FALSE.

See Also

Examples

testEqual(matrix(1:10,10,2), array(1:10, c(10,2)))
testEqual(matrix(1:10,10,1),1:10)

tframe

Time Frame Coding Kernel

v2015.12-1.1
GPL-2
Authors
Paul Gilbert <pgilbert.ttv9z@ncf.ca>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.