equal: Compare two Objects

Description Usage Arguments Value Examples

View source: R/test_tools.R

Description

The utility function equal can be used to compare two objects and is mainly used for testing purposes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
equal(x, y, ...)

## S3 method for class 'NULL'
equal(x, y, ...)

## S3 method for class 'logical'
equal(x, y, ...)

## S3 method for class 'integer'
equal(x, y, ...)

## S3 method for class 'numeric'
equal(x, y, ...)

## S3 method for class 'character'
equal(x, y, ...)

## S3 method for class 'list'
equal(x, y, ...)

## S3 method for class 'simple_triplet_matrix'
equal(x, y, ...)

Arguments

x

an R object to be compared with object y.

y

an R object to be compared with object x.

...

optional arguments to equal.

Value

TRUE if x and y are equal FALSE otherwise.

Examples

1
2
## compare numeric values
equal(1e-4, 1e-5, tol=1e-3)

PythonInR documentation built on May 2, 2019, 5:17 p.m.