Skip to content
Prev 7705 / 12125 Next

[R-pkg-devel] New 'extptr.as.ref' argument in identical() causing check failures

identical() already checks that two objects S4 are the same - so if that's what you want, then you don't need to do anything, R provides.

I assumed you want to decide if two objects are semantically equal even if the two objects are not identical, but can still be equal - let's say because you include some additional information in the object that you want to skip when deciding equivalence. In that case == is the way to go. If your object does not have vector semantics, then you just return a scalar, e.g. let's take an example from a class you're familiar with:

WGS84 and EPSG: 4326 are the same CRS:
[1] TRUE

but the objects are not necessarily identical:
[1] FALSE

Cheers,
Simon