Skip to content
Prev 57511 / 63421 Next

'==' operator: inconsistency in data.frame(...) == NULL

Dear Martin,

thanks a lot for looking into this. Of course you were right that the 
fix was not complete - I apologize for not having tested what I believed 
to be the solution.

My comments on the S4 classes seemed to stem from a misunderstanding on 
my side. I now believe to understand that S4 classes that inherit from R 
base object types might dispatch Ops for the same object types.

If the base object value of such S4 classes is unset and therefore 
empty, this empty value will be passed on to e.g. Ops.data.frame where 
it would trigger the same issue as e.g. logical(0).

setClass("MyClass", slots = list(x="numeric", label="character"), 
contains = "numeric")
a = new("MyClass", x=3, label="FOO")
a at .Data

 > logical(0)

a == data.frame(a=1:3)
# error

I understand that this is all as expected and the error should most 
likely disappear with the fix you submitted for other 0-extent cases.

Thanks again and best regards,

Hilmar

Am 18/09/2019 um 11:29 schrieb Martin Maechler: