Macaulay2 » Documentation
Packages » RInterface » RObject » RObject == RObject
next | previous | forward | backward | up | index | toc

RObject == RObject -- equality of R objects

Description

Test whether two R objects are equal.

i1 : x = RObject 5

o1 = [1] 5

o1 : RObject of type integer
i2 : y = RObject 2

o2 = [1] 2

o2 : RObject of type integer
i3 : x == y

o3 = false
i4 : x == x

o4 = true

One of the operands may be a Macaulay2 object. It will be converted to an RObject before the operation is performed.

i5 : x == 5

o5 = true
i6 : 5 == y

o6 = false

Note that these operators return Macaulay2 Boolean objects and not R logical vectors. In particular, they are not useful for comparing vectors of length greater than 1. To do this, you may use RFunction to get the corresponding R operator as a function.

i7 : (RFunction "==")({1, 2, 3}, {2, 2, 2})

o7 = [1] FALSE  TRUE FALSE

o7 : RObject of type logical

See also

Ways to use this method:


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/RInterface/doc/relational.m2:44:0.